-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 azure pipelines to GitHub Actions #4730
Merged
Merged
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
4168a5f
Run isort, black, mypy, flake8 checks via pre-commit
andersy005 24c7d78
Fix line ending
andersy005 855d6b5
Fix end of line
andersy005 8f9f81b
Fix mypy pre-commit hook. Thanks @keewis
andersy005 eb6581d
Add main CI
andersy005 b37d894
Add additional CI
andersy005 60d08eb
Fetch all history for all branches and tags
andersy005 bdd3986
Add windows environment
andersy005 26604a5
Import xarray
andersy005 6445b47
Add doctests workflow
andersy005 80da331
Add minimum version policy workflow
andersy005 32114b2
Simplify if logic
andersy005 4eacb65
Add flaky and backend-api-v2 settings
andersy005 4c6252b
Fix if elif else statements
andersy005 002ab25
Fix typo
andersy005 e65c655
Remove azure pipelines configurations
andersy005 06b8334
Fix environment file name
andersy005 e70fb89
Merge branch 'master' of github.com:pydata/xarray into ci/migrate-to-GHA
andersy005 edf8d14
Upload code coverage for additional CI
andersy005 ec1e5fc
Cache conda pkgs_dir
andersy005 257529b
Fix cache key
andersy005 26a0316
Remove unnecessary cache number variable
andersy005 b2287ae
Merge branch 'master' of github.com:pydata/xarray into ci/migrate-to-GHA
andersy005 8530374
Use `runner.os` instead of `matrix.os`
andersy005 e6baaa2
Use RUNNER_OS env variable
andersy005 3c8da76
Disable name for the time being
andersy005 28eca4b
Another attempt at setting name
andersy005 b834919
`runner.os` doesn't work. Use `matrix.os` instead
andersy005 310bc06
Merge branch 'master' of github.com:pydata/xarray into ci/migrate-to-GHA
andersy005 646b079
Update env creation guidelines
andersy005 c4b4139
Add `pre-commit run --all-files` check
andersy005 ffcebe2
Merge branch 'master' of github.com:pydata/xarray into ci/migrate-to-GHA
andersy005 b2c46db
Merge branch 'master' of github.com:pydata/xarray into ci/migrate-to-GHA
andersy005 8437d12
Update blackdoc version
andersy005 ffe53b9
Merge branch 'master' of github.com:pydata/xarray into ci/migrate-to-GHA
andersy005 afaf4b6
Add new pre-commit hooks
andersy005 1a8ba88
Add some of the out-of-the box hooks
andersy005 133bb6c
Merge branch 'master' of github.com:pydata/xarray into ci/migrate-to-GHA
andersy005 09ee1f6
Formatting only
andersy005 3c96c19
Remove bad change
andersy005 8760d15
Remove isort and add pre-commit
andersy005 8446ada
Fix bad merge
andersy005 5bf36f1
Enable `cfgrib` on windows for the time being
andersy005 fe10a28
Disable cfgrib on windows
andersy005 954cc69
Remove coveralls
andersy005 86e7dc6
Merge branch 'master' of github.com:pydata/xarray into ci/migrate-to-GHA
andersy005 fa5bb1f
Formatting only
andersy005 3df58b7
Remove remaining reference to azure pipelines
andersy005 c7a91d7
Remove py 3.6 from CI matrix
andersy005 1328110
Merge branch 'master' of github.com:pydata/xarray into ci/migrate-to-GHA
andersy005 7c4de89
Use py37
andersy005 c60dcd9
Remove all references to py36 env file
andersy005 5e6ddf2
Add check for skip ci
andersy005 93ff1ce
rename job to `detect ci trigger`
andersy005 3cf7d3e
[skip ci] Empty commit
andersy005 a6f4d60
[skip-ci] Test skip CI trigger
andersy005 fe18db1
Update PR template
andersy005 f4088f6
Fix typ
andersy005 c869ee2
GH markdown doesn't like lists in <sub></sub>
andersy005 11fdc01
Merge branch 'master' of github.com:pydata/xarray into ci/migrate-to-GHA
andersy005 5c6c49b
Remove the `-OO` flag for consistency
andersy005 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,4 @@ limitPerRun: 1 # start with a small number | |
|
||
# issues: | ||
# exemptLabels: | ||
# - confirmed | ||
# - confirmed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
name: CI Additional | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
workflow_dispatch: # allows you to trigger manually | ||
|
||
jobs: | ||
detect-ci-trigger: | ||
name: detect ci trigger | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' || github.event_name == 'pull_request' | ||
outputs: | ||
triggered: ${{ steps.detect-trigger.outputs.trigger-found }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ./.github/actions/detect-ci-trigger | ||
id: detect-trigger | ||
with: | ||
keyword: "[skip-ci]" | ||
|
||
test: | ||
name: ${{ matrix.os }} ${{ matrix.env }} | ||
runs-on: ${{ matrix.os }} | ||
needs: detect-ci-trigger | ||
if: needs.detect-ci-trigger.outputs.triggered == 'false' | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
env: | ||
[ | ||
"py37-bare-minimum", | ||
"py37-min-all-deps", | ||
"py37-min-nep18", | ||
"py38-all-but-dask", | ||
"py38-backend-api-v2", | ||
"py38-flaky", | ||
] | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/cancel-workflow-action@0.6.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags. | ||
|
||
- name: Set environment variables | ||
run: | | ||
if [[ ${{ matrix.env }} == "py38-backend-api-v2" ]] ; | ||
then | ||
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV | ||
echo "XARRAY_BACKEND_API=v2" >> $GITHUB_ENV | ||
|
||
elif [[ ${{ matrix.env }} == "py38-flaky" ]] ; | ||
then | ||
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV | ||
echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV | ||
|
||
else | ||
echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV | ||
fi | ||
- name: Cache conda | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: | ||
${{ runner.os }}-conda-${{ matrix.env }}-${{ | ||
hashFiles('ci/requirements/**.yml') }} | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
channels: conda-forge | ||
channel-priority: strict | ||
mamba-version: "*" | ||
activate-environment: xarray-tests | ||
auto-update-conda: false | ||
python-version: 3.8 | ||
use-only-tar-bz2: true | ||
|
||
- name: Install conda dependencies | ||
run: | | ||
mamba env update -f $CONDA_ENV_FILE | ||
|
||
- name: Install xarray | ||
run: | | ||
python -m pip install --no-deps -e . | ||
|
||
- name: Version info | ||
run: | | ||
conda info -a | ||
conda list | ||
python xarray/util/print_versions.py | ||
- name: Import xarray | ||
run: | | ||
python -c "import xarray" | ||
- name: Run tests | ||
run: | | ||
python -m pytest -n 4 \ | ||
--cov=xarray \ | ||
--cov-report=xml \ | ||
$PYTEST_EXTRA_FLAGS | ||
|
||
- name: Upload code coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests,${{ matrix.env }} | ||
env_vars: RUNNER_OS | ||
name: codecov-umbrella | ||
fail_ci_if_error: false | ||
doctest: | ||
name: Doctests | ||
runs-on: "ubuntu-latest" | ||
needs: detect-ci-trigger | ||
if: needs.detect-ci-trigger.outputs.triggered == 'false' | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/cancel-workflow-action@0.6.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags. | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
channels: conda-forge | ||
channel-priority: strict | ||
mamba-version: "*" | ||
activate-environment: xarray-tests | ||
auto-update-conda: false | ||
python-version: "3.8" | ||
|
||
- name: Install conda dependencies | ||
run: | | ||
mamba env update -f ci/requirements/environment.yml | ||
- name: Install xarray | ||
run: | | ||
python -m pip install --no-deps -e . | ||
- name: Version info | ||
run: | | ||
conda info -a | ||
conda list | ||
python xarray/util/print_versions.py | ||
- name: Run doctests | ||
run: | | ||
python -m pytest --doctest-modules xarray --ignore xarray/tests | ||
|
||
min-version-policy: | ||
name: Minimum Version Policy | ||
runs-on: "ubuntu-latest" | ||
needs: detect-ci-trigger | ||
if: needs.detect-ci-trigger.outputs.triggered == 'false' | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/cancel-workflow-action@0.6.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags. | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
channels: conda-forge | ||
channel-priority: strict | ||
mamba-version: "*" | ||
auto-update-conda: false | ||
|
||
- name: minimum versions policy | ||
run: | | ||
mamba install -y pyyaml | ||
python ci/min_deps_check.py ci/requirements/py37-bare-minimum.yml | ||
python ci/min_deps_check.py ci/requirements/py37-min-all-deps.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: linting | ||
|
||
on: | ||
push: | ||
branches: "*" | ||
pull_request: | ||
branches: "*" | ||
|
||
jobs: | ||
linting: | ||
name: "pre-commit hooks" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/action@v2.0.0 | ||
keewis marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
workflow_dispatch: # allows you to trigger manually | ||
|
||
jobs: | ||
detect-ci-trigger: | ||
name: detect ci trigger | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' || github.event_name == 'pull_request' | ||
outputs: | ||
triggered: ${{ steps.detect-trigger.outputs.trigger-found }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ./.github/actions/detect-ci-trigger | ||
id: detect-trigger | ||
with: | ||
keyword: "[skip-ci]" | ||
test: | ||
name: ${{ matrix.os }} py${{ matrix.python-version }} | ||
keewis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runs-on: ${{ matrix.os }} | ||
needs: detect-ci-trigger | ||
if: needs.detect-ci-trigger.outputs.triggered == 'false' | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
python-version: ["3.7", "3.8"] | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/cancel-workflow-action@0.6.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags. | ||
- name: Set environment variables | ||
run: | | ||
if [[ ${{ matrix.os }} == windows* ]] ; | ||
then | ||
echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV | ||
else | ||
echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV | ||
|
||
fi | ||
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | ||
|
||
- name: Cache conda | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: | ||
${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ | ||
hashFiles('ci/requirements/**.yml') }} | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
channels: conda-forge | ||
channel-priority: strict | ||
mamba-version: "*" | ||
activate-environment: xarray-tests | ||
auto-update-conda: false | ||
python-version: ${{ matrix.python-version }} | ||
use-only-tar-bz2: true | ||
|
||
- name: Install conda dependencies | ||
run: | | ||
mamba env update -f $CONDA_ENV_FILE | ||
|
||
- name: Install xarray | ||
run: | | ||
python -m pip install --no-deps -e . | ||
|
||
- name: Version info | ||
run: | | ||
conda info -a | ||
conda list | ||
python xarray/util/print_versions.py | ||
- name: Import xarray | ||
run: | | ||
python -c "import xarray" | ||
- name: Run tests | ||
run: | | ||
python -m pytest -n 4 \ | ||
--cov=xarray \ | ||
--cov-report=xml | ||
|
||
- name: Upload code coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
env_vars: RUNNER_OS,PYTHON_VERSION | ||
name: codecov-umbrella | ||
fail_ci_if_error: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This action was moved into its own repository.
You can replace
uses: ./.github/actions/detect-ci-trigger
with