Automatic backup 2024-12-05 #367
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: Code quality | |
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Need to read all commits in order to git describe project's version | |
fetch-depth: 0 | |
- name: Install poetry | |
run: pip install poetry | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: poetry | |
- name: Install dependencies | |
run: 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 | |
if: matrix.python == '3.8' | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.branch.name=${{ github.ref_name }} | |
-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=tests | |
-Dsonar.test.inclusions=tests/* |