-
Notifications
You must be signed in to change notification settings - Fork 10
78 lines (67 loc) · 1.74 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Unit Tests
on:
push:
branches: [ "main" ]
paths:
- src/**
- test/**
pull_request:
branches: [ "main" ]
paths:
- src/**
- test/**
schedule:
- cron: '35 22 * * 5'
env:
# Path to the CMake build directory.
build: '${{ github.workspace }}/build'
config: 'Release'
permissions:
contents: read
jobs:
test:
permissions:
checks: write
pull-requests: write
name: Unit Test
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.0'
setup-python: 'false'
- name: Install Linux Dependencies
run: |
sudo apt-get update -y
sudo apt-get install libxcb-cursor0
- name: Build
shell: pwsh
run: |
mkdir ${{ env.build }}
cd ${{ env.build }}
cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=${{ env.config }} -DSKY_TESTS=ON ../
cmake --build . --verbose
- name: Test
id: runtests
run: |
cd ${{ env.build }}/test
xvfb-run ctest . -C ${{ env.config }} \
--output-on-failure \
--verbose \
--output-junit unit-tests.xml
- name: Upload Test Report
if: ${{ always() && steps.runtests.outcome == 'failure'}}
uses: actions/upload-artifact@v4
with:
name: TestReport
path: |
${{ env.build }}/test/unit-tests.xml
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
${{ env.build }}/test/unit-tests.xml