summaryrefslogtreecommitdiff
path: root/.github/workflows/check-and-publish.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/check-and-publish.yml')
-rw-r--r--.github/workflows/check-and-publish.yml37
1 files changed, 20 insertions, 17 deletions
diff --git a/.github/workflows/check-and-publish.yml b/.github/workflows/check-and-publish.yml
index 10831bf..60e0319 100644
--- a/.github/workflows/check-and-publish.yml
+++ b/.github/workflows/check-and-publish.yml
@@ -12,12 +12,26 @@ on:
jobs:
- checks:
+ quality-checks:
+ name: Code QA
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - run: pip install black flake8 isort
+ - run: black --version
+ - run: isort --version
+ - run: flake8 --version
+ - run: isort --check .
+ - run: black --check .
+ - run: flake8 .
+
+ platform-checks:
+ needs: quality-checks
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-latest, macos-latest]
- python-version: ["2.7", "3.6", "3.7", "3.8", "3.9"]
+ python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
name: Python ${{ matrix.python-version }} on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
@@ -31,32 +45,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- - name: Tokens
- shell: python
- env:
- CDSAPIRC: ${{ secrets.CDSAPIRC }}
-
- run: |
- from __future__ import print_function
- import os
- for n in ('CDSAPIRC',):
- m = os.path.expanduser("~/." + n.lower())
- if os.environ[n]:
- with open(m, "w") as f:
- print(os.environ[n], file=f)
-
- name: Tests
+ env:
+ CDSAPI_URL: https://cds.climate.copernicus.eu/api/v2
+ CDSAPI_KEY: ${{ secrets.CDSAPI_KEY }}
run: |
python setup.py develop
pip install pytest
pytest
deploy:
+ needs: platform-checks
if: ${{ github.event_name == 'release' }}
name: Upload to Pypi
- needs: checks
runs-on: ubuntu-latest