-
Notifications
You must be signed in to change notification settings - Fork 21
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
Move tests to GitHub Actions #36
Changes from 4 commits
f715352
dc1ef15
dcc89f4
073669f
1787f6d
bad5d85
77bc8e3
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Cancel | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Tests", "Upstream", "Linting"] | ||
types: | ||
- requested | ||
|
||
jobs: | ||
cancel: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: styfle/cancel-workflow-action@0.8.0 | ||
with: | ||
workflow_id: ${{ github.event.workflow.id }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
Comment on lines
+11
to
+12
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 went ahead and added a Python 3.9 build as well as windows and macOS builds |
||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Conda Environment | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniconda-version: "latest" | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: ci/environment-${{ matrix.python-version }}.yml | ||
activate-environment: xhistogram_test_env | ||
auto-activate-base: false | ||
|
||
- name: Install | ||
shell: bash -l {0} | ||
run: python -m pip install -e . | ||
|
||
- name: Run tests | ||
shell: bash -l {0} | ||
run: python -m pytest --cov=xhistogram --cov-report=xml xhistogram | ||
|
||
- name: Coverage | ||
uses: codecov/codecov-action@v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Upstream | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Conda Environment | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniconda-version: "latest" | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: ci/environment-${{ matrix.python-version }}.yml | ||
activate-environment: xhistogram_test_env | ||
auto-activate-base: false | ||
|
||
- name: Install upstream packages | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install git+https://github.com/dask/dask.git | ||
python -m pip install git+https://github.com/pydata/xarray.git | ||
- name: Install | ||
shell: bash -l {0} | ||
run: python -m pip install -e . | ||
|
||
- name: Run tests | ||
shell: bash -l {0} | ||
run: python -m pytest --cov=xhistogram --cov-report=xml xhistogram | ||
|
||
- name: Coverage | ||
uses: codecov/codecov-action@v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: xhistogram_test_env | ||
dependencies: | ||
- python=3.6 | ||
- xarray | ||
# Dask 2021.3.0 introduced a regression which broke xhistogram. | ||
# This regression should be fixed in the next Dask release and we | ||
# should remove the dask version pinning below. | ||
# see https://github.com/dask/dask/pull/7391 | ||
# and https://github.com/xgcm/xhistogram/issues/27 | ||
- dask!=2021.3.0 | ||
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. From #34 |
||
- numpy=1.16 | ||
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. Instead of testing NumPy 1.16 and 1.17 on Python 3.6, the changes here test NumPy 1.16 on Python 3.6 and NumPy 1.17 on Python 3.7. My guess is this isn't a big deal, but let me know if we should changes what's here |
||
- pytest | ||
- pip | ||
- pip: | ||
- codecov | ||
- pytest-cov |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: xhistogram_test_env | ||
dependencies: | ||
- python=3.7 | ||
- xarray | ||
# Dask 2021.3.0 introduced a regression which broke xhistogram. | ||
# This regression should be fixed in the next Dask release and we | ||
# should remove the dask version pinning below. | ||
# see https://github.com/dask/dask/pull/7391 | ||
# and https://github.com/xgcm/xhistogram/issues/27 | ||
- dask!=2021.3.0 | ||
- numpy=1.17 | ||
- pytest | ||
- pip | ||
- pip: | ||
- codecov | ||
- pytest-cov |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: xhistogram_test_env | ||
dependencies: | ||
- python=3.8 | ||
- xarray | ||
# Dask 2021.3.0 introduced a regression which broke xhistogram. | ||
# This regression should be fixed in the next Dask release and we | ||
# should remove the dask version pinning below. | ||
# see https://github.com/dask/dask/pull/7391 | ||
# and https://github.com/xgcm/xhistogram/issues/27 | ||
- dask!=2021.3.0 | ||
- numpy | ||
- pytest | ||
- pip | ||
- pip: | ||
- codecov | ||
- pytest-cov |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: xhistogram_test_env | ||
dependencies: | ||
- python=3.9 | ||
- xarray | ||
# Dask 2021.3.0 introduced a regression which broke xhistogram. | ||
# This regression should be fixed in the next Dask release and we | ||
# should remove the dask version pinning below. | ||
# see https://github.com/dask/dask/pull/7391 | ||
# and https://github.com/xgcm/xhistogram/issues/27 | ||
- dask!=2021.3.0 | ||
- numpy | ||
- pytest | ||
- pip | ||
- pip: | ||
- codecov | ||
- pytest-cov |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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 workflow will cancel duplicate CI builds. For example, when rapidly pushing commits to a PR, if there are CI builds still running from an older commit they will be cancelled