Merge pull request #267 from BRGM/pre-commit-ci-update-config #112
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: "🎳 Tester" | |
on: | |
push: | |
branches: [master] | |
paths: | |
- "**.py" | |
pull_request: | |
branches: [master] | |
paths: | |
- "**.py" | |
env: | |
PROJECT_FOLDER: "gml_application_schema_toolbox" | |
# PYTEST_DEBUG: false | |
PYTHON_VERSION: 3.7 | |
jobs: | |
tests-unit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get source code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Python requirements | |
run: | | |
python -m pip install -U pip setuptools wheel | |
python -m pip install -U -r requirements/testing.txt | |
- name: Run Unit tests | |
run: pytest tests/unit/ | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
test-qgis: | |
runs-on: ubuntu-20.04 | |
container: | |
image: qgis/qgis:release-3_16 | |
env: | |
DISPLAY: ":99" | |
options: -v ${{ github.workspace }}:/tests_directory | |
steps: | |
- name: Get source code | |
uses: actions/checkout@v3 | |
- name: Print QGIS version | |
run: qgis --version | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Python requirements | |
run: | | |
python3 -m pip install -U pip setuptools wheel | |
python3 -m pip install -U -r requirements/testing.txt | |
- name: Run Unit tests | |
run: pytest tests/qgis/ | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 |