Skip to content

Commit 6fa1541

Browse files
committed
chore: Send coverage report to codeclimate, codecov and SonarCloud
Send coverage report to codeclimate, codecov and SonarCloud again as well as test for all python- and os-versions.
1 parent 5767b70 commit 6fa1541

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

.github/workflows/python-package.yml

+41-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
19-
python-version: ["3.12"] #, "3.11", "3.10", "3.9"]
20-
os: [ubuntu-latest] #, macOS-latest, windows-latest]
19+
python-version: ["3.12", "3.11", "3.10", "3.9"]
20+
os: [ubuntu-latest, macOS-latest, windows-latest]
2121
fail-fast: false
2222

2323
steps:
@@ -29,6 +29,43 @@ jobs:
2929
- name: Install dependencies
3030
run: |
3131
pdm install -dG test
32-
- name: Run Tests
32+
- name: Run Tests
3333
run: |
34-
pdm run pytest
34+
pdm run pytest
35+
coverage:
36+
needs: ci
37+
runs-on: ubuntu-latest
38+
strategy:
39+
matrix:
40+
python-version: ["3.12"]
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Set up PDM
44+
uses: pdm-project/setup-pdm@v4
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
- name: Install dependencies
48+
run: |
49+
pdm install -dG test
50+
# See: https://remarkablemark.org/blog/2023/10/14/setup-codeclimate-with-github-actions/
51+
- uses: remarkablemark/setup-codeclimate@v2
52+
- name: Run Tests and report to CodeClimate
53+
run: |
54+
cc-test-reporter before-build
55+
pdm run pytest
56+
cc-test-reporter after-build --exit-code $?
57+
env:
58+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
59+
60+
# See: https://martinheinz.dev/blog/69 "Ultimate CI Pipeline for All of Your Python Projects"
61+
- name: Use Codecov to track coverage
62+
uses: codecov/codecov-action@v4
63+
with:
64+
token: ${{ secrets.CODECOV_TOKEN }}
65+
files: ./coverage.xml # coverage report
66+
67+
- name: SonarCloud scanner
68+
uses: sonarsource/sonarcloud-github-action@master
69+
env:
70+
GITHUB_TOKEN: ${?{ secrets.GITHUB_TOKEN }}
71+
SONAR_TOKEN: ${?{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)