-
Notifications
You must be signed in to change notification settings - Fork 147
79 lines (74 loc) · 2.29 KB
/
ci-build.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
name: Build and Test
on:
- pull_request
- push
jobs:
# Linux builds.
#
# gcc sometimes warns (e.g. about potentially uninitialized variables) only
# when some optimizations are enabled. So we build Debug as well as Release
# on Linux. The Debug build also collects and uploads test coverage.
linux-debug:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: CFLAGS='--coverage -Werror' cmake -DCMAKE_BUILD_TYPE=Debug -G 'Unix Makefiles' .
- name: Build
run: make VERBOSE=1
- name: Test
run: python3 ./scripts/run-tests.py
- name: Create coverage report
run: |
sudo apt-get install -y lcov
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage report
uses: codecov/codecov-action@v3
linux-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: CFLAGS='--coverage -Werror' cmake -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' .
- name: Build
run: make VERBOSE=1
- name: Test
run: python3 ./scripts/run-tests.py
# Windows builds.
#
# We do both 32 and 64-bit builds. Also note 32-bit does Debug build while
# 64-bit one does Release build. (Full matrix would likely be an overkill.)
windows-32-debug:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Dev command prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=Debug -G "NMake Makefiles" .
- name: Build
run: nmake
- name: Test
run: python .\scripts\run-tests.py
windows-64-release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Dev command prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" .
- name: Build
run: nmake
- name: Test
run: python .\scripts\run-tests.py