-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (60 loc) · 2.25 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
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/*