Repository navigation
158 lines (152 loc) · 6.78 KB
/
Copy pathci.yml
File metadata and controls
158 lines (152 loc) · 6.78 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
name: Continuous Integration
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
GTEST_COLOR: 1
jobs:
host_build_test_ubuntu:
name: Host Build & Test (ubuntu-latest)
runs-on: ubuntu-latest
steps:
- name: Configure Git
run: |
git config --global url."https://${{ secrets.PRIVATE_REPO_TOKEN }}@github.com/".insteadOf "https://github.com/"
git config --global url."https://github.com/".insteadOf "git@github.com:"
git config --global --add safe.directory '*'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
with:
key: ${{ github.job }}-ubuntu-latest
max-size: 2G
save: ${{ github.ref == 'refs/heads/main' }}
- uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
- name: Install Qt6
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends qt6-base-dev libgl1-mesa-dev
- uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9
with:
configurePreset: "host"
buildPreset: "host-Debug-WithPackage"
testPreset: "host"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']"
- name: Verify package contents
run: |
set -euo pipefail
archive=$(ls build/host/numerical-toolbox-*-Linux.tar.gz)
echo "Inspecting $archive"
headers=$(tar -tzf "$archive" | grep -c 'include/numerical/.*\.hpp' || true)
exports=$(tar -tzf "$archive" | grep -c 'cmake/NumericalToolbox/NumericalToolboxTargets\.cmake' || true)
config=$(tar -tzf "$archive" | grep -c 'cmake/NumericalToolbox/NumericalToolboxConfig\.cmake' || true)
echo "numerical headers: $headers, target export: $exports, package config: $config"
test "$headers" -gt 50
test "$exports" -eq 1
test "$config" -eq 1
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: numerical-toolbox
path: build/host/numerical-toolbox-*-Linux.tar.gz
if-no-files-found: error
- name: Upload test logs
if: ${{ failure() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-logs
path: build/host/Testing/Temporary/
qemu_arm_tests:
name: QEMU ARM Tests (${{ matrix.preset }})
runs-on: ubuntu-latest
container:
image: gabrielfrasantos/embedded-devcontainer-cpp:v7.3.0@sha256:4f92e9c86dfc5a9688b6134944e7a40c9eb3c658022ea62dc9e57e4c3b056940
strategy:
fail-fast: false
matrix:
preset: [qemu-cortex-m4, qemu-cortex-m7]
steps:
- name: Configure Git
run: |
git config --global url."https://${{ secrets.PRIVATE_REPO_TOKEN }}@github.com/".insteadOf "https://github.com/"
git config --global url."https://github.com/".insteadOf "git@github.com:"
git config --global --add safe.directory '*'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
with:
key: ${{ github.job }}-${{ matrix.preset }}
max-size: 2G
save: ${{ github.ref == 'refs/heads/main' }}
- uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9
with:
configurePreset: ${{ matrix.preset }}
buildPreset: ${{ matrix.preset }}-RelWithDebInfo
testPreset: ${{ matrix.preset }}
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']"
- name: Upload test logs
if: ${{ failure() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-logs-${{ matrix.preset }}
path: build/${{ matrix.preset }}/Testing/Temporary/
host_build_test:
name: Host Build & Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
cache-variant: ccache
cmake-args: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']"
# The Visual Studio generator ignores compiler launchers; sccache cannot cache /Zi, so debug info is embedded (/Z7).
# CC/CXX make run-cmake skip its vcpkg-based MSVC setup; msvc-dev-cmd already did it.
- os: windows-latest
cache-variant: sccache
cmake-args: "['-GNinja', '-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache', '-DCMAKE_POLICY_DEFAULT_CMP0141=NEW', '-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded']"
cc: cl
fail-fast: false
steps:
- name: Configure Git
run: |
git config --global url."https://${{ secrets.PRIVATE_REPO_TOKEN }}@github.com/".insteadOf "https://github.com/"
git config --global url."https://github.com/".insteadOf "git@github.com:"
git config --global --add safe.directory '*'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- if: ${{ runner.os == 'Windows' }}
uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
- uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
with:
variant: ${{ matrix.cache-variant }}
key: ${{ github.job }}-${{ matrix.os }}
max-size: 2G
save: ${{ github.ref == 'refs/heads/main' }}
- uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cc }}
with:
configurePreset: "host-single-Debug"
buildPreset: "host-single-Debug"
testPreset: "host-single-Debug"
configurePresetAdditionalArgs: ${{ matrix.cmake-args }}
- name: Upload test logs
if: ${{ failure() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-logs-${{ matrix.os }}
path: build/host-single-Debug/Testing/Temporary/