-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (58 loc) · 1.82 KB
/
codecov.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
---
name: Code Coverage Check
on:
push:
branches:
- main
pull_request:
paths:
- '**.py'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up poetry and install
uses: ./.github/actions/setup-poetry
with:
python-version: "3.9"
- name: Run tests
run: make test-code-cov
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.xml
sonarcloud:
if: ${{ github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url }}
name: SonarCloud
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Get coverage
uses: actions/download-artifact@v4
with:
name: coverage
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@49e6cd3b187936a73b8280d59ffd9da69df63ec9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.python.coverage.reportPaths=coverage.xml
-Dsonar.tests=tests/
-Dsonar.sources=trestlebot/
-Dsonar.python.version=3.10
-Dsonar.projectKey=rh-psce_trestle-bot
-Dsonar.organization=rh-psce
- name: SonarQube Quality Gate check
uses: sonarsource/sonarqube-quality-gate-action@f9fe214a5be5769c40619de2fff2726c36d2d5eb
# Force to fail step after specific time
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}