Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💚 Migrate CI from CircleCI to GHA #67

Merged
merged 7 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions .circleci/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[run]
omit =
tests/*.py
setup.py
setup.py
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,

* @dcherian @andersy005 @mnlevy1981
# * @dcherian @andersy005 @mnlevy1981


# any files in the pop_tools directory at the root of the
# repository and any of its subdirectories.

/pop_tools/ @matt-long @klindsay28
# /pop_tools/ @matt-long @klindsay28
78 changes: 78 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: '0 0 * * *' # Daily “At 00:00”
workflow_dispatch: # allows you to trigger manually

jobs:
build:
name: python-${{ matrix.python-version }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8']
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: '*'
activate-environment: pop-tools-dev
auto-update-conda: false
python-version: ${{ matrix.python-version }}

- name: Set up conda environment
run: |
mamba env update -f ci/environment.yml
python -m pip install .
conda list

- name: Run Tests
run: |
python -m pytest --cov=./ --cov-report=xml --verbose

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false

upstream-dev:
name: upstream-dev
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: '*'
activate-environment: pop-tools-dev
auto-update-conda: false
python-version: 3.8
- name: Set up conda environment
run: |
mamba env update -f ci/environment-upstream-dev.yml
python -m pip install .
conda list

- name: Run Tests
run: |
python -m pytest --cov=./ --cov-report=xml --verbose
15 changes: 15 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: linting

on:
push:
branches: '*'
pull_request:
branches: '*'

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
60 changes: 0 additions & 60 deletions .github/workflows/main.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Upload Python Package
name: Publish pop-tools to PyPI

on:
release:
types: [created]
types:
- published

jobs:
deploy:
Expand All @@ -16,11 +17,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools setuptools-scm wheel twine
python -m pip install setuptools setuptools-scm wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/* --skip-existing
python -m twine upload dist/* --skip-existing
71 changes: 42 additions & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: double-quote-string-fixer

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
- id: double-quote-string-fixer

- repo: https://github.com/ambv/black
rev: 19.3b0
hooks:
- repo: https://github.com/ambv/black
rev: 20.8b1
hooks:
- id: black
args: ["--line-length", "100", "--skip-string-normalization"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- repo: https://github.com/keewis/blackdoc
rev: v0.3
hooks:
- id: blackdoc

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8

- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.20
hooks:
- id: isort
args: ["-w", "100"]
- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.6.4
hooks:
- id: isort

- repo: https://github.com/prettier/pre-commit
rev: 57f39166b5a5a504d6808b87ab98d41ebf095b46
hooks:
- id: prettier

- repo: https://github.com/asottile/blacken-docs
rev: v1.0.0
hooks:
- id: blacken-docs
- repo: https://github.com/nbQA-dev/nbQA
rev: 0.5.3
hooks:
- id: nbqa-black
additional_dependencies: [black==20.8b1]
- id: nbqa-pyupgrade
additional_dependencies: [pyupgrade==2.7.3]
- id: nbqa-isort
additional_dependencies: [isort==5.6.4]
3 changes: 3 additions & 0 deletions .prettierrc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tabWidth = 2
semi = false
singleQuote = true
13 changes: 6 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ POP-tools: Tools to support analysis of POP2-CESM model solutions with xarray
=============================================================================


.. image:: https://img.shields.io/github/workflow/status/NCAR/pop-tools/code-style?label=Code%20Style&style=for-the-badge
:target: https://github.com/NCAR/pop-tools/actions
:alt: GitHub Workflow Status
.. image:: https://img.shields.io/github/workflow/status/NCAR/pop-tools/CI?label=CI&logo=github&style=for-the-badge
:target: https://github.com/NCAR/pop-tools/actions?query=workflow%3ACI
:alt: GitHub Workflow CI Status


.. image:: https://img.shields.io/circleci/project/github/NCAR/pop-tools/master.svg?style=for-the-badge&logo=circleci
:target: https://circleci.com/gh/NCAR/pop-tools/tree/master
.. image:: https://img.shields.io/github/workflow/status/NCAR/pop-tools/linting?label=linting&logo=github&style=for-the-badge
:target: https://github.com/NCAR/pop-tools/actions?query=workflow%3Alinting
:alt: GitHub Workflow Linting Status

.. image:: https://img.shields.io/codecov/c/github/NCAR/pop-tools.svg?style=for-the-badge
:target: https://codecov.io/gh/NCAR/pop-tools


.. image:: https://img.shields.io/readthedocs/pop-tools/latest.svg?style=for-the-badge
:target: https://pop-tools.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
Expand Down
Loading