-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 1.27 KB
/
test.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
name: Tests
on: push
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip install -e .[tests]
- run: python -m pytest --cov=sme_contrib --cov-report=xml -v
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
name: ${{ matrix.os }}-${{ matrix.python-version }}
fail_ci_if_error: true
verbose: true
# https://stackoverflow.com/questions/12844451/test-test-coverage-with-python-in-sonar-not-showing-up
- run: coverage xml -i
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
- uses: sonarsource/sonarcloud-github-action@master
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}