-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create test_pysteps.yml * Install gcc for macos * Do not install pygrib on win * Add black check * Run black on PR * Run only on pushes to master * Upload to codecov Co-authored-by: Andres Perez Hortal <andresperezcba@gmail.com> Co-authored-by: Andres Perez Hortal <aperezhortal@gmail.com> Co-authored-by: Ruben Imhoff <31476760+RubenImhoff@users.noreply.github.com>
- Loading branch information
1 parent
4c988ad
commit 221a28f
Showing
8 changed files
with
199 additions
and
204 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This workflow will test the code base using the LATEST version of black | ||
|
||
# IMPORTANT: Black is under development. Hence, minor fommatting changes between | ||
# different version are expected. | ||
# If this test fails, install the latest version of black and then run black. | ||
# Preferably, run black only on the files that you have modified. | ||
# This will faciliate the revision of the proposed changes. | ||
|
||
name: Black | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install black | ||
- name: Black version | ||
run: black --version | ||
|
||
- name: Black check | ||
working-directory: ${{github.workspace}} | ||
run: black --check . |
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,108 @@ | ||
name: Test Pysteps installation | ||
|
||
env: | ||
MINIMAL_DEPENDENCIES: cython numpy jsmin jsonschema matplotlib netCDF4 opencv pillow pyproj scipy dask | ||
OPTIONAL_DEPENDENCIES: dask pyfftw cartopy h5py PyWavelets | ||
TEST_DEPENDENCIES: pytest pytest-cov codecov | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
unit_tests: | ||
name: Unit Tests (${{ matrix.python-version }}, ${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] | ||
python-version: [ "3.6", "3.8" ] | ||
max-parallel: 6 | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2.0.0 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
channels: conda-forge | ||
channel-priority: flexible | ||
activate-environment: test-environment | ||
|
||
- name: Install dependencies | ||
env: | ||
PACKAGES: ${{env.MINIMAL_DEPENDENCIES}} ${{env.OPTIONAL_DEPENDENCIES}} ${{env.TEST_DEPENDENCIES}} | ||
PYSTEPS_DATA_PATH: ${{github.workspace}}/pysteps_data | ||
run: | | ||
conda install --quiet ${{env.PACKAGES}} | ||
- name: Install pysteps for MacOS | ||
if: matrix.os == 'macos-latest' | ||
working-directory: ${{github.workspace}} | ||
env: | ||
CC: gcc-9 | ||
CXX: g++-9 | ||
CXX1X: g++-9 | ||
HOMEBREW_NO_INSTALL_CLEANUP: 1 | ||
run: | | ||
brew update-reset | ||
brew update | ||
brew install gcc@9 | ||
gcc-9 --version | ||
pip install . | ||
- name: Install pygrib (not win) | ||
if: matrix.os != 'windows-latest' | ||
run: conda install --quiet pygrib | ||
|
||
- name: Install pysteps | ||
if: matrix.os != 'macos-latest' | ||
working-directory: ${{github.workspace}} | ||
run: pip install . | ||
|
||
- name: Download pysteps data | ||
env: | ||
PYSTEPS_DATA_PATH: ${{github.workspace}}/pysteps_data | ||
working-directory: ${{github.workspace}}/ci | ||
run: python fetch_pysteps_data.py | ||
|
||
- name: Check imports | ||
working-directory: ${{github.workspace}}/pysteps_data | ||
run: | | ||
python -c "import pysteps; print(pysteps.__file__)" | ||
python -c "from pysteps import motion" | ||
python -c "from pysteps.motion import vet" | ||
python -c "from pysteps.motion import proesmans" | ||
- name: Run tests and coverage report | ||
working-directory: ${{github.workspace}}/pysteps_data | ||
env: | ||
PYSTEPSRC: ${{github.workspace}}/pysteps_data/pystepsrc | ||
run: pytest --pyargs pysteps --cov=pysteps --cov-report=xml --cov-report=term -ra | ||
|
||
- name: Upload coverage to Codecov (Linux only) | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: codecov/codecov-action@v1 | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.python-version }} | ||
with: | ||
file: ${{github.workspace}}/pysteps_data/coverage.xml | ||
flags: unit_tests | ||
env_vars: OS,PYTHON | ||
fail_ci_if_error: true | ||
verbose: true |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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.