-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 1.48 KB
/
unit-tests.yml
File metadata and controls
76 lines (63 loc) · 1.48 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
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
name: Run unit tests.
on:
push:
branches:
- main
pull_request:
branches:
- main
# paths:
# - 'CMakeLists.txt'
# - 'cmake/*'
# - 'samples/*'
# - 'src/*'
# - 'tools/*'
# - 'tests/*'
jobs:
run-unit-tests:
runs-on: ubuntu-24.04
steps:
- name: Check out repository code.
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Pipx.
id: install-pipx
run: |
sudo apt update && sudo apt install pipx
sudo apt install -y pipx
pipx --version
- name: Install Invoke.
id: install-invoke
run: |
pipx install invoke
- name: Run setup.
id: invoke-setup
run: |
inv setup
- name: Restore PCH cache.
uses: actions/cache@v3
with:
path: test-build/CMakeFiles/*.dir/cmake_pch.hxx*
key: ${{ runner.os }}-pch
- name: List PCH.
id: list-pch
run: |
if [ "${{ steps.cache.outputs.cache-hit }}" == "true" ]; then
find test-build/ -iname 'cmake_pch.hxx*'
else
echo "No cache hit. PCH files will be rebuilt."
fi
- name: Build tests.
id: build-tests
run: |
inv build --mode=test-build --parallel --ci-build
- name: Save build cache
uses: actions/cache@v3
with:
path: test-build/CMakeFiles/
key: ${{ runner.os }}-pch
- name: Run tests.
id: run-tests
run: |
./test-build/crow_tests