-
-
Notifications
You must be signed in to change notification settings - Fork 105
240 lines (230 loc) · 8.53 KB
/
main.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
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
name: Build FreeRTOS-Emulator
on:
pull_request:
branches:
- master
- pong
- clean
- udp_demo
- ci
push:
branches:
- master
# - pong
# - clean
# - udp_demo
# - ci
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
name: Standard Build
runs-on: ubuntu-latest
steps:
- name: Install SDL2 Dependencies
run: sudo apt-get install -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev
- name: Checkout code
uses: actions/checkout@v2
- name: Configure CMake
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
- name: Build with CMake
run: cd build && make
doxygen:
name: Doxygen Build
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Doxygen Dependencies
run: sudo apt-get update && sudo apt-get install -y doxygen graphviz fonts-freefont-ttf
- name: Generate docs
shell: bash
run: mkdir -p build && cd build && cmake -DDOCS_ONLY=on .. && make docs
- name: Print warnings
run: |
if [[ -s "doxygen_warnings.txt" ]]; then
echo "You must fix doxygen before submitting a pull request"
echo "Build doxygen: 'cmake -DDOCS=ON .. & make docs'"
echo ""
cat doxygen_warnings.txt
exit -1
fi
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: docs/docs/html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
git_check:
name: Run Git Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run Check and Print Warning
run: |
if [[ -n $(git diff --check HEAD^) ]]; then
echo "You must remove whitespace before submitting a pull request"
echo ""
git diff --check HEAD^
exit -1
fi
astyle_format:
name: Run AStyle Format
runs-on: ubuntu-latest
steps:
- name: Install SDL2 Dependencies
run: sudo apt-get install -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev astyle
- name: Checkout code
uses: actions/checkout@v2
- name: Configure CMake
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_ASTYLE=ON ..
- name: Build with CMake
run: cd build && make
- name: Run Checks
run: cd build && make format
- name: Print Warnings
run: |
if [[ -n $(git diff) ]]; then
echo "You must run make format before submitting a pull request"
echo ""
git diff
exit -1
fi
clang_tidy:
name: Run Clang Tidy
runs-on: ubuntu-latest
steps:
- name: Install SDL2 Dependencies
run: sudo apt-get install -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev
- name: Checkout code
uses: actions/checkout@v2
- name: Install Latest Clang
run: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
- name: Install CLang Dependencies
run: sudo apt-get install -y clang clang-tidy
- name: Configure CMake
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_CLANG_TIDY=ON ..
- name: Build with CMake
run: cd build && make
- name: Run Checks
run: cd build && make tidy > output.txt
- name: Print Warnings
run: |
if [[ -n $(grep "error: " build/output.txt) ]]; then
echo "You must pass the clang tidy checks before submitting a pull request"
echo "cmake -DENABLE_CLANG_TIDY=ON .. & make tidy"
echo ""
grep --color -E '^|error: ' build/output.txt
exit -1
elif [[ -n $(grep "warning: " build/output.txt) ]]; then
echo "Warnings:"
grep --color -E '^|warning: ' build/output.txt
echo -e "\033[1;32m\xE2\x9C\x93 passed - with warnings\033[0m $1"
exit 0
else
echo -e "\033[1;32m\xE2\x9C\x93 passed - no warnings\033[0m $1"
exit 0
fi
cppcheck:
name: Run CPPCheck
runs-on: ubuntu-latest
steps:
- name: Install SDL2 Dependencies
run: sudo apt-get install -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev cppcheck
- name: Checkout code
uses: actions/checkout@v2
- name: Configure CMake
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_CPPCHECK=ON ..
- name: Build with CMake
run: cd build && make
- name: Run Checks
run: cd build && make check
google_asan:
name: Run Google Address Sanitizer
runs-on: ubuntu-latest
steps:
- name: Install SDL2 Dependencies
run: sudo apt-get install -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev
- name: Checkout code
uses: actions/checkout@v2
- name: Configure CMake
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_ASAN=ON ..
- name: Build with CMake
run: cd build && make
- name: Install xvfb
run: sudo apt-get install xvfb -y
- name: Run Address Sanitizer on Executable (with fake DISPLAY and dummy AUDIODEV)
run: cd build && AUDIODEV=null xvfb-run --auto-servernum ./../bin/FreeRTOS_Emulator & sleep 20
- name: Kill Program
run: killall FreeRTOS_Emulator || echo "Nothing running..."
- name: Check for Errors
run: echo "TODO"
google_usan:
name: Run Google Undefined Sanitizer
runs-on: ubuntu-latest
steps:
- name: Install SDL2 Dependencies
run: sudo apt-get install -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev
- name: Checkout code
uses: actions/checkout@v2
- name: Configure CMake
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_USAN=ON ..
- name: Build with CMake
run: cd build && make
- name: Install xvfb
run: sudo apt-get install xvfb -y
- name: Run Undefined Sanitizer on Executable (with fake DISPLAY and dummy AUDIODEV)
run: cd build && AUDIODEV=null xvfb-run --auto-servernum ./../bin/FreeRTOS_Emulator & sleep 20
- name: Kill Program
run: killall FreeRTOS_Emulator || echo "Not running..."
- name: Check for Errors
run: echo "TODO"
google_tsan:
name: Run Google Thread Sanitizer
runs-on: ubuntu-latest
steps:
- name: Install SDL2 Dependencies
run: sudo apt-get install -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev
- name: Checkout code
uses: actions/checkout@v2
- name: Configure CMake
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_TSAN=ON ..
- name: Build with CMake
run: cd build && make
- name: Install xvfb
run: sudo apt-get install xvfb -y
- name: Run Thread Sanitizer on Executable (with fake DISPLAY and dummy AUDIODEV)
run: cd build && AUDIODEV=null xvfb-run --auto-servernum ./../bin/FreeRTOS_Emulator & sleep 20
- name: Kill Program
run: killall FreeRTOS_Emulator || echo "Not running..."
- name: Check for Errors
run: echo "TODO"
codecov:
name: Run Codecov
runs-on: ubuntu-latest
steps:
- name: Install SDL2 Dependencies
run: sudo apt-get install -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev
- name: Checkout code
uses: actions/checkout@v2
- name: Configure CMake
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_COVERAGE=ON ..
- name: Build with CMake
run: cd build && make
- name: Setup Test
run: cd build && make test & sleep 20
- name: Publish to Codecov
#run: bash <(curl -s https://codecov.io/bash)
uses: codecov/codecov-action@v1