Quality Assurance #376
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: Quality Assurance | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
types: [opened, synchronize, reopened] | |
schedule: | |
- cron: 0 16 * * * | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
env: | |
PYTHON: ${{ matrix.python-version }} | |
steps: | |
- name: Install gdal | |
run: | | |
sudo apt update | |
sudo apt install gdal-bin | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Run tox targets for ${{ matrix.python-version }} | |
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .) | |
- name: upload coverage reports | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-reports | |
path: ./coverage.xml | |
sonarcloud: | |
needs: ["test"] | |
name: SonarCloud analyzes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out | |
uses: actions/checkout@master | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: download coverage reports | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-reports | |
path: ./ | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |