-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (47 loc) · 1.39 KB
/
test.yaml
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
name: test CI
on:
pull_request:
branches:
- main
paths:
- "otaclient/**"
- "tests/**"
- ".github/workflows/test.yaml"
push:
branches:
- main
paths:
- "otaclient/**"
- "tests/**"
- ".github/workflows/test.yaml"
# allow the test CI to be manually triggerred
workflow_dispatch:
jobs:
pytest_with_coverage:
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- name: Checkout commit
uses: actions/checkout@v3
# sonarcloud needs full git histories
with:
fetch-depth: 0
- name: Build ota-test_base docker image
run: |
docker compose -f docker/docker-compose_tests.yml build
- name: Execute pytest with coverage trace under ota-test_base container
run: |
mkdir -p test_result
docker compose -f docker/docker-compose_tests.yml up --abort-on-container-exit
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
continue-on-error: true
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# export the coverage report to the comment!
- name: Add coverage report to PR comment
continue-on-error: true
uses: MishaKav/[email protected]
with:
pytest-xml-coverage-path: test_result/coverage.xml
junitxml-path: test_result/pytest.xml