Skip to content

tests

tests #921

name: tests
on:
schedule:
- cron: 0 0 * * *
push:
jobs:
build-and-test:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install GDAL
run: |
sudo apt-get update
sudo apt-get install -y \
libgdal-dev
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade tox-gh-actions
- name: Run tests
run: |
tox
- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
with:
name: py${{ matrix.python-version }}
path: .tox/test-results.xml
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v2
if: success() && matrix.python-version == 3.11
publish-test-results:
name: Publish unit test results
needs: build-and-test
runs-on: ubuntu-latest
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Publish test results to GitHub
uses: EnricoMi/publish-unit-test-result-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: artifacts/**/*.xml