-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (36 loc) · 1.07 KB
/
unit-tests.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
name: Unit-Tests
on:
push:
branches:
- main
pull_request:
branches:
- '*'
jobs:
test:
# Prevent circular workflow run
if: "!contains(github.event.pusher.name, 'emnify-gha')"
name: Run Unit-Tests
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Install dependencies
run: pip install -r req.txt
- name: Run tests
run: pytest --cov=. --cov-report=xml
- name: Export SonarCloud Result
# Skip dependabot runs because they don't have access to secrets
if: "!contains(github.ref, 'dependabot')"
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: sdk-coverage-result
path: coverage.xml