-
-
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
Changes from 59 commits
4168a5f
24c7d78
855d6b5
8f9f81b
eb6581d
b37d894
60d08eb
bdd3986
26604a5
6445b47
80da331
32114b2
4eacb65
4c6252b
002ab25
e65c655
06b8334
e70fb89
edf8d14
ec1e5fc
257529b
26a0316
b2287ae
8530374
e6baaa2
3c8da76
28eca4b
b834919
310bc06
646b079
c4b4139
ffcebe2
b2c46db
8437d12
ffe53b9
afaf4b6
1a8ba88
133bb6c
09ee1f6
3c96c19
8760d15
8446ada
5bf36f1
fe10a28
954cc69
86e7dc6
fa5bb1f
3df58b7
c7a91d7
1328110
7c4de89
c60dcd9
5e6ddf2
93ff1ce
3cf7d3e
a6f4d60
fe18db1
f4088f6
c869ee2
11fdc01
5c6c49b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
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/[email protected] | ||
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 -OO -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/[email protected] | ||
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/[email protected] | ||
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 |
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/[email protected] | ||
keewis marked this conversation as resolved.
Show resolved
Hide resolved
|
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/[email protected] | ||
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 -OO -c "import xarray" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we currently don't use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andersy005 - thoughts on this one? Otherwise I think we merge this and follow up with dev doc updates. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have a preference. I used the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great, thanks. If we had a specific reason for |
||
- 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 |
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