-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.16 KB
/
test.yml
File metadata and controls
45 lines (37 loc) · 1.16 KB
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
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# For SonarCloud Analysis
# Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pipenv
run: |
python -m pip install --upgrade pip
pip install pipenv==2022.6.7
- name: Install requirements
run: pipenv install --dev
- name: Tests
run: pipenv run tests
- name: Patch Coverage Source Path for SonarCloud
run: sed -i 's/\/home\/runner\/work\/coding-katas-python\/coding-katas-python\//\/github\/workspace\//g' coverage-reports/coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.projectVersion=${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}