-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (137 loc) · 5.46 KB
/
Copy pathci-cpp.yml
File metadata and controls
159 lines (137 loc) · 5.46 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
159
name: CI C++
on:
workflow_dispatch:
push:
branches:
- main
- 'release/*'
pull_request:
jobs:
devcontainer:
name: Build & Test (${{ matrix.toolchain }})
runs-on: [ubuntu-latest]
container:
image: ghcr.io/philips-software/amp-devcontainer-cpp:6.10.3@sha256:e1f388179dbeabaddcdd37b8b563ed89ca3cd36dcf158aa2e5c4f70eb513efec
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
strategy:
fail-fast: false
matrix:
toolchain: [ gcc, clang ]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Cache CPM packages
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cpm
key: cpm-${{ hashFiles('cpp/cmake/dependencies.cpm.cmake') }}
restore-keys: cpm-
- name: Cache ccache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.toolchain }}-${{ github.ref }}
restore-keys: ccache-${{ matrix.toolchain }}-
- name: Configure
working-directory: cpp
run: cmake --preset Coverage --toolchain cmake/toolchains/${{ matrix.toolchain }}.cmake -DCPM_SOURCE_CACHE=~/.cpm
- name: Build
working-directory: cpp
run: cmake --build --preset Coverage
- name: Test
working-directory: cpp
run: ctest --preset Coverage --test-dir build/Coverage
compiler-versions:
name: ${{ matrix.cxx }}-${{ matrix.version }}
runs-on: ["${{ matrix.runner }}"]
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
strategy:
fail-fast: false
matrix:
include:
- { cc: gcc, cxx: g++, version: 11, runner: ubuntu-24.04 }
- { cc: gcc, cxx: g++, version: 12, runner: ubuntu-24.04 }
- { cc: gcc, cxx: g++, version: 13, runner: ubuntu-24.04 }
- { cc: gcc, cxx: g++, version: 14, runner: ubuntu-24.04 }
- { cc: clang, cxx: clang++, version: 16, runner: ubuntu-22.04 }
- { cc: clang, cxx: clang++, version: 17, runner: ubuntu-24.04 }
- { cc: clang, cxx: clang++, version: 18, runner: ubuntu-24.04 }
- { cc: clang, cxx: clang++, version: 19, runner: ubuntu-24.04 }
- { cc: clang, cxx: clang++, version: 20, runner: ubuntu-24.04 }
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build ccache
- name: Install GCC ${{ matrix.version }}
if: matrix.cc == 'gcc'
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.version }} g++-${{ matrix.version }}
- name: Install Clang ${{ matrix.version }}
if: matrix.cc == 'clang'
run: |
wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh
chmod +x /tmp/llvm.sh
sudo /tmp/llvm.sh ${{ matrix.version }}
- name: Cache CPM packages
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cpm
key: cpm-${{ hashFiles('cpp/cmake/dependencies.cpm.cmake') }}
restore-keys: cpm-
- name: Cache ccache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.cc }}-${{ matrix.version }}-${{ github.ref }}
restore-keys: ccache-${{ matrix.cc }}-${{ matrix.version }}-
- name: Configure
working-directory: cpp
run: >
cmake --preset Coverage
-DCMAKE_C_COMPILER=${{ matrix.cc }}-${{ matrix.version }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }}-${{ matrix.version }}
-DCPM_SOURCE_CACHE=~/.cpm
- name: Build
working-directory: cpp
run: cmake --build --preset Coverage
- name: Test
working-directory: cpp
run: ctest --preset Coverage --test-dir build/Coverage
mutation:
name: Mutation Testing
runs-on: ["ubuntu-latest"]
container:
image: ghcr.io/philips-software/amp-devcontainer-cpp:6.10.3@sha256:e1f388179dbeabaddcdd37b8b563ed89ca3cd36dcf158aa2e5c4f70eb513efec
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Cache CPM packages
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cpm
key: cpm-${{ hashFiles('cpp/cmake/dependencies.cpm.cmake') }}
restore-keys: cpm-
- name: Cache ccache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-mutation-${{ github.ref }}
restore-keys: ccache-mutation-
- name: Configure
working-directory: cpp
run: cmake --preset Mutation -DCPM_SOURCE_CACHE=~/.cpm
- name: Build
working-directory: cpp
run: cmake --build --preset Mutation
- name: Run mutation tests
working-directory: cpp
run: cmake --build --preset Mutation --target mutation-test