-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (127 loc) · 4.36 KB
/
cpp-ci.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
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
name: C++ CI
on:
push:
branches:
- master
- releases/v*
pull_request:
merge_group:
jobs:
build-and-test:
name: Test ${{ matrix.os }}-${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022]
compiler: [gcc, clang, msvc]
exclude:
- os: windows-2022
compiler: gcc
- os: ubuntu-22.04
compiler: msvc
include:
- os: ubuntu-22.04
triplet: x64-linux
- os: windows-2022
triplet: x64-windows
env:
CTEST_OUTPUT_ON_FAILURE: "1"
steps:
- uses: actions/checkout@v3
- name: Install go (boringSSL build dependency)
if: ${{ !startsWith(matrix.os, 'windows-') }}
uses: actions/setup-go@v4
with:
go-version: '>=1.20.7'
- name: Install nasm (boringSSL build dependency)
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: |
sudo apt-get -qq update
sudo apt-get -qq install nasm
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.6
- name: Initialize vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
vcpkgGitCommitId: f6a5d4e8eb7476b8d7fc12a56dff300c1c986131
prependedCacheKey: compiler=${{ matrix.compiler }}
#appendedCacheKey: r00
- name: Build ${{ matrix.triplet }}-${{ matrix.compiler }} preset
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.triplet }}-${{ matrix.compiler }}
buildPreset: ${{ matrix.triplet }}-${{ matrix.compiler }}
testPreset: ${{ matrix.triplet }}-${{ matrix.compiler }}
env:
CC: ''
CXX: ''
- name: Build ${{ matrix.triplet }}-${{ matrix.compiler }}-release preset
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.triplet }}-${{ matrix.compiler }}
buildPreset: ${{ matrix.triplet }}-${{ matrix.compiler }}-release
testPreset: ${{ matrix.triplet }}-${{ matrix.compiler }}-release
env:
CC: ''
CXX: ''
- name: Prevent uploading a corrupted vcpkg cache
if: ${{ failure() || cancelled() }}
run: |
echo "RUNVCPKG_NO_CACHE=1" >> $GITHUB_ENV
shell: bash
check-format:
name: clang-tidy & clang-format
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: "Install clang-tools-15"
run: |
sudo cp ${{ github.workspace }}/tools/llvm-snapshot.gpg.key.asc /etc/apt/trusted.gpg.d/llvm-snapshot.asc
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
sudo apt-get -qq update
sudo apt-get -qq -y install clang-15 clang-tidy-15 clang-format-15
- name: Install go (boringSSL build dependency)
uses: actions/setup-go@v4
with:
go-version: '>=1.20.7'
- name: Install nasm (boringSSL build dependency)
run: |
sudo apt-get -qq update
sudo apt-get -qq install nasm
- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.6
- name: Initialize vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: ${{ github.workspace }}/../vcpkg
vcpkgGitCommitId: f6a5d4e8eb7476b8d7fc12a56dff300c1c986131
prependedCacheKey: compiler=clang-15
#appendedCacheKey: r00
- name: Configure x64-linux-clang preset
uses: lukka/run-cmake@v10
with:
configurePreset: x64-linux-ci-lint
- uses: cpp-linter/cpp-linter-action@v2
name: Lint with clang-format and clang-tidy
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: 15.0.7
style: file # use .clang-format settings
tidy-checks: '' # use .clang-tidy settings
extensions: cpp,hpp
ignore: '.github|build|external'
files-changed-only: true
database: build/x64-linux-ci-lint
- name: Fail if issues have been raised
if: steps.linter.outputs.checks-failed > 0
run: exit 1
- if: ${{ failure() || cancelled() }}
run: |
echo "RUNVCPKG_NO_CACHE=1" >> $GITHUB_ENV
shell: bash