-
Notifications
You must be signed in to change notification settings - Fork 1
230 lines (227 loc) · 6.94 KB
/
ci.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
name: CI
on:
push:
pull_request:
jobs:
build-windows:
name: ${{matrix.os}}-${{ matrix.sys }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: msys2 {0}
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
sys: [mingw64, mingw32, ucrt64, clang64, clang32]
steps:
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
install: base-devel
pacboy: toolchain:p
- name: Checkout
uses: actions/checkout@v4
- name: Compile runtime
run: make nujel.exe
- name: Test runtime
run: make test
release-windows:
name: release-${{ matrix.sys }}-windows
needs: static-checks
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
strategy:
fail-fast: false
matrix:
sys: [mingw32, mingw64, ucrt64, clang64, clang32]
steps:
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
install: base-devel
pacboy: toolchain:p
- name: Checkout
uses: actions/checkout@v4
- name: Compile release
run: make release
- name: Run Tests
run: ./nujel.exe --slow-test tools/tests.nuj
- name: Upload release
uses: actions/upload-artifact@v4
with:
name: Nujel-windows-${{ matrix.sys }}-release-${{ github.ref_name }}
path: "./nujel.exe"
retention-days: 7
build-macos:
name: build-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-13, macos-12, macos-11]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compile runtime
run: make nujel
- name: Test runtime
run: make test
release-macos:
name: ${{ matrix.buildtype }}-macos
needs: static-checks
strategy:
fail-fast: false
matrix:
buildtype: [release]
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Release
run: make ${{ matrix.buildtype }}
- name: Test runtime
run: ./nujel --slow-test tools/tests.nuj
- name: Upload release
uses: actions/upload-artifact@v4
with:
name: Nujel-macos-${{ github.ref_name }}-${{ matrix.buildtype }}
path: "./nujel"
retention-days: 7
build-linux:
name: ${{ matrix.os }}-${{ matrix.cc }}-${{matrix.make}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
cc: [clang, gcc]
make: [make]
include:
- os: ubuntu-22.04
cc: gcc
make: bmake
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install compiler
run: |
sudo apt-get -y install ${{ matrix.cc }} ${{ matrix.make }}
- name: Compile runtime
run: ${{matrix.make}} CC=${{ matrix.cc }} nujel
- name: Test runtime
run: ${{matrix.make}} CC=${{ matrix.cc }} test
build-wasm:
name: wasm-clang-make
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install compiler
run: |
sudo apt-get -y install wasi-libc
curl https://wasmtime.dev/install.sh -sSf | sudo bash
wget https://github.com/bytecodealliance/wasmtime/releases/download/v14.0.4/wasmtime-v14.0.4-x86_64-linux.tar.xz
tar -xvf wasmtime-v14.0.4-x86_64-linux.tar.xz
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz
tar -xvf wasi-sdk-20.0-linux.tar.gz
- name: Compile runtime
run: |
make nujel.wasm WASI_CLANG=./wasi-sdk-20.0/bin/clang WASI_SDK_PATH=./wasi-sdk-20.0/share/wasi-sysroot/ WASI_STRIP=./wasi-sdk-20.0/bin/strip
- name: Test runtime
run: ./wasmtime-v14.0.4-x86_64-linux/wasmtime --dir=. nujel.wasm tools/tests.nuj
build-stdlib:
name: Build stdlib from source
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc]
make: [make, bmake]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install compiler
run: sudo apt-get -y install ${{ matrix.cc }} ${{ matrix.make }}
- name: Test runtime
run: ${{matrix.make}} CC=${{ matrix.cc }} test.future.slow
static-analysis-linux:
name: Clang - static analysis
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install compiler
run: |
sudo apt-get -y install clang clang-tools make
- name: Run static analyzer
run: scan-build --status-bugs make nujel
valgrind-linux:
name: Valgrind - memory leak check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install compiler
run: |
sudo apt-get update && sudo apt-get -y install valgrind
- name: Check for leaks
run: make valgrind
static-checks:
name: Static checks
needs: [valgrind-linux, static-analysis-linux, build-stdlib, build-linux, build-macos, build-windows, build-wasm]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
release-linux:
name: ${{ matrix.buildtype }}-linux
runs-on: ubuntu-latest
needs: static-checks
strategy:
fail-fast: false
matrix:
buildtype: [release, release.musl]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y musl-dev musl-tools
- name: Build release
run: make ${{ matrix.buildtype }}
- name: Test runtime
run: ./nujel --slow-test tools/tests.nuj
- name: Upload release
uses: actions/upload-artifact@v4
with:
name: Nujel-linux-${{ github.ref_name }}-${{ matrix.buildtype }}
path: "./nujel"
retention-days: 7
release-wasm:
name: release.wasm
runs-on: ubuntu-latest
needs: static-checks
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install compiler
run: |
sudo apt-get -y install wasi-libc
wget https://github.com/bytecodealliance/wasmtime/releases/download/v14.0.4/wasmtime-v14.0.4-x86_64-linux.tar.xz
tar -xvf wasmtime-v14.0.4-x86_64-linux.tar.xz
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz
tar -xvf wasi-sdk-20.0-linux.tar.gz
- name: Compile runtime
run: make release.wasm WASI_CLANG=./wasi-sdk-20.0/bin/clang WASI_SDK_PATH=./wasi-sdk-20.0/share/wasi-sysroot/ WASI_STRIP=./wasi-sdk-20.0/bin/strip
- name: Test runtime
run: ./wasmtime-v14.0.4-x86_64-linux/wasmtime --dir=. nujel.wasm --slow-test tools/tests.nuj
- name: Upload release
uses: actions/upload-artifact@v4
with:
name: Nujel-wasm-${{ github.ref_name }}-release
path: "./nujel.wasm"
retention-days: 7