Update ci/cd setup to check with py3.9 till py3.11 (#385) #424
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
--- | |
name: Python tests | |
on: | |
push: | |
pull_request: | |
branches: [master] | |
jobs: | |
windows-conda-tests: | |
runs-on: "windows-latest" | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniconda-version: "latest" | |
environment-file: environment.yml | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
channel-priority: true | |
- name: Run unit tests | |
shell: powershell | |
run: | | |
pip install . --no-deps | |
pip install -r dev-requirements.txt coverage | |
pytest --cov niche_vlaanderen --cov-report xml --verbose --tb=long | |
- name: Upload coverage | |
run: | | |
python -m pip install coveralls | |
coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_PARALLEL: true | |
linux-pip-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies & run unit tests | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install libgdal-dev gdal-bin pandoc | |
python -m pip install --upgrade pip | |
pip install coveralls wheel | |
ls | |
pip install -r dev-requirements.txt | |
pytest --cov niche_vlaanderen --cov --verbose --tb=long | |
- name: Upload coverage | |
run: | | |
python -m pip install coveralls | |
COVERALLS_PARALLEL=true coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
finish-coverage: | |
runs-on: ubuntu-latest | |
needs: | |
- windows-conda-tests | |
- linux-pip-tests | |
steps: | |
- name: Coveralls finished | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.github_token }} | |
parallel-finished: true |