-
Notifications
You must be signed in to change notification settings - Fork 228
56 lines (51 loc) · 1.33 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Unit Tests
on:
pull_request:
# Run for all PRs to develop - means PR cannot merge until unit tests pass
branches:
- develop
# Skip non-code changes
paths-ignore:
- '.github/**'
- 'integrations/**'
- 'swirl-infra/**'
- 'docs/**'
- 'README.md'
- 'db.sqlite3.dist'
workflow_dispatch:
permissions:
contents: read
actions: read
checks: write
pull-requests: write
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout the Code
uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.6'
cache: 'pip'
- name: Install Swirl
run: ./install.sh
- name: Install the Unit Tests
run: ./install-test.sh
- name: Run the Unit Tests
# generate a JUnit XML report for the test results
run: pytest --junitxml=reports/junit.xml --tb=short --ignore=integrations
- name: Upload Log Files
if: always()
uses: actions/upload-artifact@v4
with:
name: log-files
path: |
logs/
/var/log/syslog*
- name: Publish Unit Test Results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: reports/junit.xml