-
Notifications
You must be signed in to change notification settings - Fork 245
195 lines (192 loc) · 7.51 KB
/
.ubuntu.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
name: x64-ubuntu
on:
schedule:
- cron: '0 0 * * 0'
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
inputs:
skip:
description: 'Delete its name if you want to keep the job'
required: false
default: 'ubuntu,gcc-thread,clang-tidy,32bit-address,32bit-undefined'
jobs:
ubuntu:
runs-on: ubuntu-20.04
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'tezc/sc')) && !contains(github.event.inputs.skip, 'ubuntu')
name: Build on Ubuntu
strategy:
fail-fast: false
matrix:
compiler: [ gcc, clang ]
steps:
- uses: actions/[email protected]
- name: build
env:
CC: ${{ matrix.compiler }}
run: |
sudo apt update
sudo apt-get install valgrind cmake
mkdir build-debug && cd build-debug
cmake .. -DSANITIZER=address
make -j
make check
rm -rf *
cmake .. -DSANITIZER=undefined
make -j
make check
rm -rf *
cmake ..
make -j
make valgrind
ubuntu-gcc-thread:
runs-on: ubuntu-latest
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'tezc/sc')) && !contains(github.event.inputs.skip, 'gcc-thread')
name: Thread sanitizer
steps:
- uses: actions/[email protected]
- name: build
env:
CC: gcc
run: |
sudo apt update
sudo apt-get install cmake
mkdir build-debug && cd build-debug
cmake .. -DSANITIZER=thread
make -j
make check
ubuntu-clang-tidy:
runs-on: ubuntu-latest
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'tezc/sc')) && !contains(github.event.inputs.skip, 'clang-tidy')
name: Clang Tidy
steps:
- uses: actions/[email protected]
- name: build
env:
CC: clang
run: |
sudo apt update
sudo apt-get install cmake clang-tidy
mkdir build-debug && cd build-debug
cmake .. -DSC_CLANG_TIDY=1
make -j
make check
ubuntu-32bit-address:
runs-on: ubuntu-latest
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'tezc/sc')) && !contains(github.event.inputs.skip, '32bit-address')
name: 32bit-address
steps:
- uses: actions/[email protected]
- name: build
env:
CC: gcc
run: |
sudo apt update
sudo apt-get install cmake gcc-multilib
mkdir build-debug && cd build-debug
cmake .. -DCMAKE_C_FLAGS=-m32 -DSANITIZER=address
make -j
make check
ubuntu-32bit-undefined:
runs-on: ubuntu-latest
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'tezc/sc')) && !contains(github.event.inputs.skip, '32bit-undefined')
name: 32bit-undefined
steps:
- uses: actions/[email protected]
- name: build
env:
CC: gcc
run: |
sudo apt update
sudo apt-get install cmake gcc-multilib
mkdir build-debug && cd build-debug
cmake .. -DCMAKE_C_FLAGS=-m32 -DSANITIZER=undefined
make -j
make check
ubuntu-zig-windows:
runs-on: ubuntu-latest
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && github.repository == 'tezc/sc')) && !contains(github.event.inputs.skip, 'zig-windows')
name: Zig Windows
steps:
- uses: actions/[email protected]
- name: build
run: |
sudo apt update
sudo apt-get install cmake curl tar wine
mkdir build-debug && cd build-debug
export ZIG=zig-linux-x86_64-0.12.0-dev.1834+f36ac227b
curl -o zig.tar.xz "https://ziglang.org/builds/$ZIG.tar.xz"
tar -xf zig.tar.xz
export CC="$(pwd)/$ZIG/zig cc -target x86_64-windows"
cmake .. -DCMAKE_SYSTEM_NAME=Windows
make -j
echo "==============" && echo sc_array_test && echo "=============="
DISPLAY= wine ./array/sc_array_test.exe
echo "==============" && echo sc_buf_test && echo "=============="
DISPLAY= wine ./buffer/sc_buf_test.exe
echo "==============" && echo sc_cond_test && echo "=============="
DISPLAY= wine ./condition/sc_cond_test.exe
echo "==============" && echo sc_crc32_test && echo "=============="
DISPLAY= wine ./crc32/sc_crc32_test.exe
echo "==============" && echo sc_heap_test && echo "=============="
DISPLAY= wine ./heap/sc_heap_test.exe
echo "==============" && echo sc_ini_test && echo "=============="
DISPLAY= wine ./ini/sc_ini_test.exe
echo "==============" && echo sc_list_test && echo "=============="
DISPLAY= wine ./linked-list/sc_list_test.exe
echo "==============" && echo sc_log_test && echo "=============="
DISPLAY= wine ./logger/sc_log_test.exe
echo "==============" && echo sc_map_test && echo "=============="
DISPLAY= wine ./map/sc_map_test.exe
echo "==============" && echo sc_mmap_test && echo "=============="
# DISPLAY= wine ./memory-map/sc_mmap_test.exe <-- hangs
echo "==============" && echo sc_mutex_test && echo "=============="
DISPLAY= wine ./mutex/sc_mutex_test.exe
echo "==============" && echo sc_option_test && echo "=============="
DISPLAY= wine ./option/sc_option_test.exe
echo "==============" && echo sc_queue_test && echo "=============="
DISPLAY= wine ./queue/sc_queue_test.exe
echo "==============" && echo sc_test && echo "=============="
DISPLAY= wine ./sc/sc_test.exe
echo "==============" && echo sc_signal_test && echo "=============="
DISPLAY= wine ./signal/sc_signal_test.exe
echo "==============" && echo sc_socket_test && echo "=============="
# DISPLAY= wine ./socket/sc_socket_test.exe <-- Assertion failed
echo "==============" && echo sc_str_test && echo "=============="
DISPLAY= wine ./string/sc_str_test.exe
echo "==============" && echo sc_thread_test && echo "=============="
DISPLAY= wine ./thread/sc_thread_test.exe
echo "==============" && echo sc_time_test && echo "=============="
# DISPLAY= wine ./time/sc_time_test.exe <-- wine: Unhandled illegal instruction
echo "==============" && echo sc_timer_test && echo "=============="
DISPLAY= wine ./timer/sc_timer_test.exe
echo "==============" && echo sc_uri_test && echo "=============="
DISPLAY= wine ./uri/sc_uri_test.exe