Skip to content

Improve github

Improve github #119

Workflow file for this run

---
name: Code quality
on: push
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip install poetry
poetry install --all-extras
- name: Pytest
run: poetry run pytest -vv
- name: Upload coverage data to coveralls.io
run: |
poetry run coveralls --service=github
- name: Lint flake8
run: poetry run flake8 . --output-file flake.log --exit-zero
- name: Lint mypy
run: poetry run mypy > mypy.log || true
- name: Lint pylint
run: poetry run pylint --output pylint.log --exit-zero $(git ls-files '*.py')
- name: Set project version
run: echo PROJECT_VERSION="$(git describe --tags | sed 's/-[^-]*$//')" >> $GITHUB_ENV
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=snejus
-Dsonar.projectKey=snejus_rich-tables
-Dsonar.projectVersion=${{ env.PROJECT_VERSION }}
-Dsonar.coverage.exclusions=tests/*
-Dsonar.exclusions=tests/*
-Dsonar.python.coverage.reportPaths=.reports/coverage.xml
-Dsonar.python.flake8.reportPaths=flake.log
-Dsonar.python.pylint.reportPaths=pylint.log
-Dsonar.python.mypy.reportPaths=mypy.log
-Dsonar.python.version=${{ matrix.python }}
-Dsonar.python.xunit.reportPath=.reports/test-report.xml
-Dsonar.sources=rich_tables
-Dsonar.tests=rich_tables
-Dsonar.test.inclusions=tests/*