-
-
Notifications
You must be signed in to change notification settings - Fork 9
165 lines (164 loc) · 5.32 KB
/
ci_action.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: CI Action
on:
push:
branches:
- '**'
- '!master'
paths-ignore:
- '**/*.md'
- '**/*.png'
pull_request:
branches:
- '**'
jobs:
build_windows:
name: Build windows_msvc
runs-on: windows-latest
defaults:
run:
shell: cmd
env:
BUILD_DIR: ${{ github.workspace }}\build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: List Workspace
run: dir /a ${{ github.workspace }}
- name: Compile
run: |
echo "== CMAKE VERSION =="
cmake --version
echo "== CMAKE CONFIGURE =="
cmake -B${{env.BUILD_DIR}} -DCLOVE_CMAKE__UC_BUILD=ON
echo "== CMAKE BUILD =="
cmake --build ${{env.BUILD_DIR}} --config Release
- name: List Build
run: dir /a ${{env.BUILD_DIR}}
- name: Test
run: |
cd ${{env.BUILD_DIR}}
ctest -C Release -T test --output-on-failure
IF %ERRORLEVEL% NEQ 0 (
exit /b %ERRORLEVEL%
)
cd ${{ github.workspace }}
build_macos:
name: Build macos_apple-clang
runs-on: macos-latest
defaults:
run:
shell: bash
env:
BUILD_DIR: ${{ github.workspace }}/build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: List Workspace
run: ls -la ${{ github.workspace }}
- name: Compile
run: |
echo "== CMAKE VERSION =="
cmake --version
echo "== CMAKE CONFIGURE =="
cmake -B${{env.BUILD_DIR}} -DCLOVE_CMAKE__UC_BUILD=ON
echo "== CMAKE BUILD =="
cmake --build ${{env.BUILD_DIR}} --config Release
- name: List Build
run: ls -la ${{env.BUILD_DIR}}
- name: Test
run: |
cd ${{env.BUILD_DIR}}
ctest -C Release -T test --output-on-failure
cd ${{ github.workspace }}
build_ubuntu:
name: Build ubuntu_${{matrix.compiler.c}}-${{matrix.compiler.v}}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler:
- {c: gcc, cpp: g++, v: 11, strict: OFF}
- {c: gcc, cpp: g++, v: 12, strict: OFF}
- {c: gcc, cpp: g++, v: 13, strict: ON}
- {c: clang, cpp: clang++, v: 13, strict: ON}
- {c: clang, cpp: clang++, v: 14, strict: ON}
- {c: clang, cpp: clang++, v: 15, strict: ON}
- {c: clang, cpp: clang++, v: 16, strict: ON}
- {c: clang, cpp: clang++, v: 17, strict: ON}
defaults:
run:
shell: bash
env:
BUILD_DIR: ${{ github.workspace }}/build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: List Workspace
run: ls -la ${{ github.workspace }}
- name: Install Clang (if needed)
uses: KyleMayes/install-llvm-action@v1
if: ${{ matrix.compiler.c == 'clang' && matrix.compiler.v > 15 }}
with:
version: "${{ matrix.compiler.v }}"
env: true # set CC / CXX variable
- name: Install GCC (if needed)
# Installing GCC-13 due to regression introduced in ubuntu 22.04 image
# https://github.com/actions/runner-images/issues/9866
if: ${{ matrix.compiler.c == 'gcc' && matrix.compiler.v == 13 }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install gcc-13
sudo apt-get install g++-13
- name: Set Compiler # only if CC / CXX are not already set from new installation
run: |
if [ -z "${CC}" ]; then
echo "CC=${{matrix.compiler.c}}-${{matrix.compiler.v}}" >> "$GITHUB_ENV"
echo "CXX=${{matrix.compiler.cpp}}-${{matrix.compiler.v}}" >> "$GITHUB_ENV"
else
echo CC=$CC
echo CXX=$CXX
fi
- name: Compile
run: |
echo "== CMAKE VERSION =="
cmake --version
echo "== CMAKE CONFIGURE =="
cmake -B${{env.BUILD_DIR}} -DCLOVE_CMAKE__UC_BUILD=ON -DCLOVE_CMAKE__CPP_STRICT_WARN_AS_ERROR=${{matrix.compiler.strict}}
echo "== CMAKE BUILD =="
cmake --build ${{env.BUILD_DIR}} --config Release
- name: List Build
run: ls -la ${{env.BUILD_DIR}}
- name: Test
run: |
cd ${{env.BUILD_DIR}}
ctest -C Release -T test --output-on-failure
cd ${{ github.workspace }}
sanity_check:
name: Sanity Check
runs-on: ubuntu-latest
defaults:
run:
shell: bash
env:
BUILD_DIR: ${{ github.workspace }}/build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: List Workspace
run: ls -la ${{ github.workspace }}
- name: Compile
run: |
echo "== CMAKE VERSION =="
cmake --version
echo "== CMAKE CONFIGURE =="
cmake -B${{env.BUILD_DIR}} -DCLOVE_CMAKE__UC_SANITY=ON
echo "== CMAKE BUILD =="
cmake --build ${{env.BUILD_DIR}} --config Release
- name: List Build
run: ls -la ${{env.BUILD_DIR}}
- name: Sanity
run: |
cd ${{env.BUILD_DIR}}
ctest -C Release -T test --output-on-failure
cd ${{ github.workspace }}