CI : améliore l'exécution des tests #4
Workflow file for this run
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: Tests | |
on: | |
push: | |
branches: | |
- develop | |
- master | |
pull_request: | |
branches: | |
- develop | |
- master | |
jobs: | |
unit-test: | |
name: "🎳 Unit tests" | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- ubuntu-22.04 | |
python-version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Get source code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
cache-dependency-path: "pyproject.toml" | |
- name: Install system dependencies | |
run: | | |
sudo apt update | |
sudo apt install gdal-bin libgdal-dev | |
export CPLUS_INCLUDE_PATH=/usr/include/gdal | |
export C_INCLUDE_PATH=/usr/include/gdal | |
gdal-config --version | |
sudo apt -y install python3-rados python3-gdal | |
- name: Install project requirements | |
run: | | |
python -m pip install -U pip setuptools wheel | |
python -m pip install GDAL=="`gdal-config --version`.*" | |
python -m pip install -e .[test] | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
- name: Run unit tests | |
run: | | |
coverage run -m pytest | |
coverage report -m | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: python_wheel | |
path: dist/* | |
if-no-files-found: error |