-
Notifications
You must be signed in to change notification settings - Fork 6
213 lines (198 loc) · 6.45 KB
/
build.yaml
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: Build PR(s) and master branch.
on:
push:
branches:
- master
pull_request:
branches:
- master
types: [opened, reopened, synchronize]
jobs:
build-windows:
name: Build sources on amd64 for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2019]
steps:
- uses: actions/checkout@v4
- name: Build on ${{ matrix.os }} with vs-2019
run: |
.\scripts\win_build.bat
- name: Run unit tests.
run: |
ctest --rerun-failed --output-on-failure -C Debug --test-dir .\tests\
build-msys2:
name: Build sources on MSYS2 for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2019]
steps:
- uses: actions/checkout@v4
- name: Get dependencies w/ chocolatey
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'
- uses: msys2/setup-msys2@v2
with:
update: true
msystem: UCRT64
path-type: inherit
install: >-
mingw-w64-ucrt-x86_64-gcc
- name: Build on ${{ matrix.os }} with MSYS2
shell: msys2 {0}
run: |
cmake -G "MinGW Makefiles" -DCFL_TESTS=On .
cmake --build .
- name: Run unit tests.
run: |
ctest --rerun-failed --output-on-failure -C Debug --test-dir .\tests\
build-centos:
name: CentOS 7 build to confirm no issues once used downstream
runs-on: ubuntu-latest
container: centos:7
env:
# workaround required for checkout@v3, https://github.com/actions/checkout/issues/1590
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Set up base image dependencies
run: |
sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo
yum -y update
yum install -y ca-certificates cmake gcc gcc-c++ git make wget
yum install -y epel-release
yum install -y cmake3
shell: bash
- name: Clone repo without submodules (1.8.3 version of Git)
run: |
git clone https://github.com/fluent/cfl.git
shell: bash
- name: Check out the branch (1.8.3 version of Git)
env:
BRANCH_NAME: ${{ github.head_ref }}
run: |
git checkout "$BRANCH_NAME"
shell: bash
working-directory: cfl
- name: Run compilation
run: |
cmake3 -DCFL_DEV=on .
make
working-directory: cfl
build-debian:
name: Debian Buster build to confirm no issues once used downstream
runs-on: ubuntu-latest
container: debian:buster
steps:
- name: Set up base image dependencies
run: |
apt-get update
apt-get install -y build-essential cmake make
shell: bash
- uses: actions/checkout@v4
- name: Run compilation
run: |
cmake -DCFL_DEV=on .
make
build-unix-arm64:
name: Build sources on arm64 for ${{ matrix.os }} - ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
compiler: [ gcc, clang ]
steps:
- uses: actions/checkout@v4
- name: Build on ${{ matrix.os }} with ${{ matrix.compiler }}
uses: uraimo/[email protected]
with:
arch: aarch64
distro: ubuntu_latest
run: |
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
file \
make
export CC=${{ env.compiler }}
cmake -DCFL_TESTS=On .
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
env:
CC: ${{ matrix.compiler }}
build-unix-amd64:
name: Build sources on amd64 for ${{ matrix.os }} - ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
compiler: [ gcc, clang ]
steps:
- uses: actions/checkout@v4
- name: Build on ${{ matrix.os }} with ${{ matrix.compiler }}
run: |
echo "CC = $CC, CXX = $CXX"
cmake -DCFL_TESTS=On .
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
env:
CC: ${{ matrix.compiler }}
build-analysis-tests:
name: Build with various code analysis tools
strategy:
fail-fast: false
matrix:
preset:
- clang-sanitize-address
- clang-sanitize-memory
- clang-sanitize-undefined
- clang-sanitize-dataflow
- clang-sanitize-safe-stack
- valgrind
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: docker://lpenz/ghaction-cmake:0.19
with:
preset: ${{ matrix.preset }}
# dependencies_debian: ''
cmakeflags: '-DCFL_TESTS=On -DCFL_DEV=on .'
build_command: make all
# this job provides the single required status for PRs to be merged into main.
# instead of updating the protected branch status in github, developers can update the needs section below
# to require additional status checks to protect main.
# the job uses the alls-green action to get around the github issue that treats a "skipped" required status check
# as passed. github will skip a job if an upstream needed job fails, which would defeat the purpose of this required
# status check.
test-required-checks-complete:
# note: this step always has to run in order to check if the dependent jobs passed. by default github skips running a job
# if the needed jobs upstream failed.
if: always()
needs:
- build-windows
- build-msys2
- build-centos
- build-debian
- build-unix-arm64
- build-unix-amd64
- build-analysis-tests
name: Required checks complete
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}