Skip to content

Commit 4f33a7f

Browse files
committed
🔀 Fix and add new Github Workflows
All of the various Github Workflows were previously broken due to Github's deprecation/removal of the `set-env` syntax (for security reasons). This promptly broke effectively all existing CI scripts, leaving this repository without any integrations. This not only fixes those existing ones, it also adds new integrations for more static code analysis, and also new workflows for coverage detection.
2 parents 1b71ac9 + c8691eb commit 4f33a7f

File tree

14 files changed

+758
-451
lines changed

14 files changed

+758
-451
lines changed

.github/workflows/analysis.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: "Code Scanning"
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'include/**.hpp'
8+
- 'test/**.cpp'
9+
- '**.cmake'
10+
- 'conanfile.py'
11+
- 'CMakeLists.txt'
12+
- 'test/CMakeLists.txt'
13+
- '.github/workflows/analysis.yml'
14+
pull_request:
15+
branches: [master]
16+
paths:
17+
- 'include/**.hpp'
18+
- 'test/**.cpp'
19+
- '**.cmake'
20+
- 'conanfile.py'
21+
- 'CMakeLists.txt'
22+
- 'test/CMakeLists.txt'
23+
- '.github/workflows/analysis.yml'
24+
25+
jobs:
26+
analysis:
27+
name: CodeQL Analysis
28+
runs-on: ubuntu-20.04
29+
30+
env:
31+
build-directory: build
32+
33+
strategy:
34+
matrix:
35+
language: ['cpp']
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v2
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v1
43+
with:
44+
python-version: 3.7
45+
46+
- name: Prepare Environment
47+
run: |
48+
python -m pip install --upgrade pip
49+
pip install conan
50+
cmake -E make_directory ${{env.build-directory}}
51+
cmake -E chdir ${{env.build-directory}} conan install ..
52+
53+
- name: Initialize CodeQL
54+
uses: github/codeql-action/init@v1
55+
56+
- name: Configure
57+
working-directory: ${{env.build-directory}}
58+
run: cmake .. -DCMAKE_BUILD_TYPE=Debug -DBACKPORT_COMPILE_UNIT_TESTS=On
59+
60+
- name: Build
61+
working-directory: ${{env.build-directory}}
62+
run: cmake --build .
63+
64+
- name: Perform CodeQL Analysis
65+
uses: github/codeql-action/analyze@v1

.github/workflows/build-macos.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: macOS
2+
3+
on:
4+
push:
5+
paths:
6+
- 'include/**.hpp'
7+
- 'test/**.cpp'
8+
- '**.cmake'
9+
- 'conanfile.py'
10+
- 'CMakeLists.txt'
11+
- 'test/CMakeLists.txt'
12+
- '.github/workflows/build-macos.yml'
13+
pull_request:
14+
paths:
15+
- 'include/**.hpp'
16+
- 'test/**.cpp'
17+
- '**.cmake'
18+
- 'conanfile.py'
19+
- 'CMakeLists.txt'
20+
- 'test/CMakeLists.txt'
21+
- '.github/workflows/build-macos.yml'
22+
23+
jobs:
24+
test:
25+
name: macOS Xcode ${{matrix.compiler.version}}
26+
runs-on: macos-latest
27+
28+
env:
29+
build-directory: build
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
compiler:
35+
# Xcode Versions
36+
- { name: "xcode", version: "10.3" }
37+
- { name: "xcode", version: "11.2" }
38+
- { name: "xcode", version: "11.3" }
39+
- { name: "xcode", version: "12.3" }
40+
41+
steps:
42+
- name: Clone
43+
uses: actions/checkout@v2
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v1
47+
with:
48+
python-version: 3.7
49+
50+
- name: Prepare Environment
51+
run: |
52+
ls -ls /Applications/
53+
sudo xcode-select -switch /Applications/Xcode_${{ matrix.compiler.version }}.app
54+
55+
python -m pip install --upgrade pip
56+
pip install conan
57+
cmake -E make_directory ${{env.build-directory}}
58+
cmake -E chdir ${{env.build-directory}} conan install ..
59+
60+
# Debug Configuration
61+
62+
- name: Configure (Debug)
63+
working-directory: ${{env.build-directory}}
64+
env:
65+
CC: clang
66+
CXX: clang++
67+
run: cmake .. -DCMAKE_BUILD_TYPE=Debug -DBACKPORT_COMPILE_UNIT_TESTS=On
68+
69+
- name: Build (Debug)
70+
working-directory: ${{env.build-directory}}
71+
run: cmake --build .
72+
73+
- name: Test (Debug)
74+
working-directory: ${{env.build-directory}}
75+
run: ctest --output-on-failure
76+
77+
# Release Configuration
78+
79+
- name: Configure (Release)
80+
working-directory: ${{env.build-directory}}
81+
run: cmake .. -DCMAKE_BUILD_TYPE=Release
82+
83+
- name: Build (Release)
84+
working-directory: ${{env.build-directory}}
85+
run: cmake --build .
86+
87+
- name: Test (Release)
88+
working-directory: ${{env.build-directory}}
89+
run: ctest --output-on-failure
90+
91+
sanitize:
92+
name: macOS Xcode ${{matrix.compiler.version}} '${{matrix.sanitizer}}' sanitizer
93+
runs-on: macos-latest
94+
needs: test
95+
96+
env:
97+
build-directory: build
98+
99+
strategy:
100+
matrix:
101+
sanitizer: [address, undefined]
102+
103+
steps:
104+
- name: Clone
105+
uses: actions/checkout@v2
106+
107+
- name: Set up Python
108+
uses: actions/setup-python@v1
109+
with:
110+
python-version: 3.7
111+
112+
- name: Prepare Environment
113+
run: |
114+
python -m pip install --upgrade pip
115+
pip install conan
116+
cmake -E make_directory ${{env.build-directory}}
117+
cmake -E chdir ${{env.build-directory}} conan install ..
118+
119+
- name: Configure
120+
working-directory: ${{env.build-directory}}
121+
env:
122+
CC: clang
123+
CXX: clang++
124+
run: |
125+
cmake .. \
126+
-DCMAKE_BUILD_TYPE=Debug \
127+
-DBACKPORT_COMPILE_UNIT_TESTS=On \
128+
-DCMAKE_CXX_FLAGS="-fsanitize=${{matrix.sanitizer}}"
129+
130+
- name: Build
131+
working-directory: ${{env.build-directory}}
132+
run: cmake --build .
133+
134+
- name: Test (Sanitize)
135+
working-directory: ${{env.build-directory}}
136+
run: ctest --output-on-failure

.github/workflows/build-ubuntu.yml

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
name: Ubuntu
2+
3+
on:
4+
push:
5+
paths:
6+
- 'include/**.hpp'
7+
- 'test/**.cpp'
8+
- '**.cmake'
9+
- 'conanfile.py'
10+
- 'CMakeLists.txt'
11+
- 'test/CMakeLists.txt'
12+
- '.github/workflows/build-ubuntu.yml'
13+
pull_request:
14+
paths:
15+
- 'include/**.hpp'
16+
- 'test/**.cpp'
17+
- '**.cmake'
18+
- 'conanfile.py'
19+
- 'CMakeLists.txt'
20+
- 'test/CMakeLists.txt'
21+
- '.github/workflows/build-ubuntu.yml'
22+
23+
jobs:
24+
test:
25+
name: Ubuntu ${{matrix.compiler.cc}} (${{matrix.arch}})
26+
runs-on: ubuntu-20.04
27+
28+
env:
29+
build-directory: build
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
compiler:
35+
# GCC Versions
36+
- { cc: gcc-5, cxx: g++-5 }
37+
- { cc: gcc-6, cxx: g++-6 }
38+
- { cc: gcc-7, cxx: g++-7 }
39+
- { cc: gcc-8, cxx: g++-8 }
40+
- { cc: gcc-9, cxx: g++-9 }
41+
- { cc: gcc-10, cxx: g++-10 }
42+
43+
# Clang Versions
44+
- { cc: clang-3.5, cxx: clang++-3.5 }
45+
- { cc: clang-3.6, cxx: clang++-3.6 }
46+
- { cc: clang-3.7, cxx: clang++-3.7 }
47+
- { cc: clang-3.8, cxx: clang++-3.8 }
48+
- { cc: clang-3.9, cxx: clang++-3.9 }
49+
- { cc: clang-4.0, cxx: clang++-4.0 }
50+
- { cc: clang-5.0, cxx: clang++-5.0 }
51+
- { cc: clang-6.0, cxx: clang++-6.0 }
52+
- { cc: clang-7, cxx: clang++-7 }
53+
- { cc: clang-8, cxx: clang++-8 }
54+
- { cc: clang-9, cxx: clang++-9 }
55+
- { cc: clang-10, cxx: clang++-10 }
56+
arch: [x86, x86_64]
57+
58+
# clang 3.5 through 3.8 fail to compiler for 32-bit
59+
# Disable these builds for time being
60+
exclude:
61+
- arch: x86
62+
compiler: { cc: clang-3.5, cxx: clang++-3.5 }
63+
- arch: x86
64+
compiler: { cc: clang-3.6, cxx: clang++-3.6 }
65+
- arch: x86
66+
compiler: { cc: clang-3.7, cxx: clang++-3.7 }
67+
- arch: x86
68+
compiler: { cc: clang-3.8, cxx: clang++-3.8 }
69+
70+
steps:
71+
- name: Clone
72+
uses: actions/checkout@v2
73+
74+
- name: Set up Python
75+
uses: actions/setup-python@v1
76+
with:
77+
python-version: 3.7
78+
79+
- name: Prepare Environment
80+
run: |
81+
if [[ "${{matrix.arch}}" == "x86" ]]; then
82+
sudo dpkg --add-architecture i386
83+
fi
84+
sudo apt-get update
85+
# Older versions of clang and gcc are not available on Ubuntu 20.04; so
86+
# we need to add the repos manually first.
87+
sudo add-apt-repository "deb http://dk.archive.ubuntu.com/ubuntu/ bionic main universe"
88+
sudo add-apt-repository "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main universe"
89+
sudo apt-get update
90+
91+
if [[ "${{matrix.compiler.cc}}" =~ "gcc" ]]; then
92+
sudo apt-get install -y ${{matrix.compiler.cxx}} ${{matrix.compiler.cxx}}-multilib
93+
else
94+
sudo apt-get install -y ${{matrix.compiler.cc}} g++-multilib
95+
96+
# g++5 needed for clang 32-bit builds
97+
if [[ "${{matrix.arch}}" == "x86" ]]; then
98+
sudo apt-get install -y g++-5
99+
fi
100+
fi
101+
102+
python -m pip install --upgrade pip
103+
pip install conan
104+
cmake -E make_directory ${{env.build-directory}}
105+
cmake -E chdir ${{env.build-directory}} conan install ..
106+
107+
- name: Prepare Architecture
108+
run: |
109+
if [[ "${{matrix.arch}}" = "x86" ]]; then
110+
echo "CXXFLAGS=${CXXFLAGS} -m32" >> ${GITHUB_ENV}
111+
fi
112+
113+
# Debug Configuration
114+
115+
- name: Configure (Debug)
116+
working-directory: ${{env.build-directory}}
117+
env:
118+
CC: ${{matrix.compiler.cc}}
119+
CXX: ${{matrix.compiler.cxx}}
120+
run: cmake .. -DCMAKE_BUILD_TYPE=Debug -DBACKPORT_COMPILE_UNIT_TESTS=On
121+
122+
- name: Build
123+
working-directory: ${{env.build-directory}}
124+
run: cmake --build .
125+
126+
- name: Test
127+
working-directory: ${{env.build-directory}}
128+
run: ctest --output-on-failure
129+
130+
# Release Configuration
131+
132+
- name: Configure (Release)
133+
working-directory: ${{env.build-directory}}
134+
run: cmake .. -DCMAKE_BUILD_TYPE=Release
135+
136+
- name: Build (Release)
137+
working-directory: ${{env.build-directory}}
138+
run: cmake --build .
139+
140+
- name: Test (Release)
141+
working-directory: ${{env.build-directory}}
142+
run: ctest --output-on-failure
143+
144+
sanitize:
145+
name: Ubuntu ${{matrix.compiler.cc}} '${{matrix.sanitizer}}' sanitizer
146+
runs-on: ubuntu-20.04
147+
needs: test
148+
149+
env:
150+
build-directory: build
151+
152+
strategy:
153+
matrix:
154+
compiler:
155+
- { cc: gcc, cxx: g++ }
156+
- { cc: clang, cxx: clang++ }
157+
sanitizer: [address, undefined]
158+
159+
steps:
160+
- name: Clone
161+
uses: actions/checkout@v2
162+
163+
- name: Set up Python
164+
uses: actions/setup-python@v1
165+
with:
166+
python-version: 3.7
167+
168+
- name: Prepare Environment
169+
run: |
170+
python -m pip install --upgrade pip
171+
pip install conan
172+
cmake -E make_directory ${{env.build-directory}}
173+
cmake -E chdir ${{env.build-directory}} conan install ..
174+
175+
- name: Configure
176+
working-directory: ${{env.build-directory}}
177+
env:
178+
CC: ${{matrix.compiler.cc}}
179+
CXX: ${{matrix.compiler.cxx}}
180+
run: |
181+
cmake .. \
182+
-DCMAKE_BUILD_TYPE=Debug \
183+
-DBACKPORT_COMPILE_UNIT_TESTS=On \
184+
-DCMAKE_CXX_FLAGS="-fsanitize=${{matrix.sanitizer}}"
185+
186+
- name: Build
187+
working-directory: ${{env.build-directory}}
188+
run: cmake --build .
189+
190+
- name: Test (Sanitize)
191+
working-directory: ${{env.build-directory}}
192+
run: ctest --output-on-failure

0 commit comments

Comments
 (0)