-
Notifications
You must be signed in to change notification settings - Fork 232
267 lines (221 loc) · 8.14 KB
/
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
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
name: GitHub CI
on:
push:
paths:
- ".github/workflows/build.yml"
- "build/**"
- "src/**"
- "!**/*.md"
branches:
- master
pull_request:
paths:
- ".github/workflows/build.yml"
- "build/**"
- "src/**"
- "!**/*.md"
branches:
- master
# Keep this in sync with the other *.yml files
env:
CI_REQ_DOTNET_SDK_VER: '8.0.x'
CI_NODE_MIN_VER: 'latest'
RUSTFLAGS: '-D warnings'
MACOSX_DEPLOYMENT_TARGET: '10.12'
JAVA_DISTRIBUTION: 'temurin'
JAVA_VERSION: '8'
jobs:
#############################################################################
#############################################################################
#############################################################################
build-dotnet:
name: C# (${{matrix.os}})
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}}
- name: Build and test
shell: bash
run: ./build/build-dotnet --quick-check
- uses: actions/upload-artifact@v4
with:
name: nupkg
path: src/csharp/Intel/Iced/bin/Release/*.*nupkg
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: coverage.info
path: src/csharp/Intel/Iced.UnitTests/coverage.info
if-no-files-found: error
- name: Upload coverage report
if: github.ref == 'refs/heads/master'
shell: bash
continue-on-error: true
run: |
# https://docs.codecov.com/docs/codecov-uploader
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
./codecov -t "${{secrets.CODECOV_TOKEN}}" -f "src/csharp/Intel/Iced.UnitTests/coverage.info"
#############################################################################
#############################################################################
#############################################################################
build-java:
name: Java (${{matrix.os}})
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: ${{env.JAVA_DISTRIBUTION}}
java-version: ${{env.JAVA_VERSION}}
- name: Build and test
shell: bash
run: ./build/build-java --quick-check
- uses: actions/upload-artifact@v4
with:
name: java
path: src/java/iced-x86/target/iced-x86*
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
build-rust:
name: Rust (${{matrix.os}})
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: bash build/ci-install-rust.sh
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}}
- name: Install kcov
shell: bash
run: |
sudo apt-get update
sudo apt-get install kcov
- name: Build and test
shell: bash
run: ./build/build-rust --no-set-rustflags --no-tests --test-current --test-msrv --test-no_std --coverage
- uses: actions/upload-artifact@v4
with:
name: rust-coverage
path: cov-out/rust/merged/
if-no-files-found: error
- name: Upload coverage report
if: github.ref == 'refs/heads/master'
shell: bash
continue-on-error: true
run: |
# https://docs.codecov.com/docs/codecov-uploader
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
./codecov -t "${{secrets.CODECOV_TOKEN}}" -f "cov-out/rust/merged/kcov-merged/cobertura.xml"
#############################################################################
#############################################################################
#############################################################################
build-rust-js-wasm:
name: JavaScript (${{matrix.os}})
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: bash build/ci-install-rust.sh
- uses: actions/setup-node@v4
with:
node-version: ${{env.CI_NODE_MIN_VER}}
- name: Install wasm-pack
shell: bash
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build and test
shell: bash
run: ./build/build-js --no-set-rustflags --quick-check
- uses: actions/upload-artifact@v4
with:
name: npm
path: src/rust/iced-x86-js/pkg/release/iced-x86-*.tgz
if-no-files-found: error
#############################################################################
#############################################################################
#############################################################################
build-rust-python-linux-x64:
name: Python (${{matrix.os}}) x64
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: bash build/ci-install-rust.sh
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install Python tools
shell: bash
run: |
python --version 2>&1 | grep 'Python 3\.8'
python -m pip install -r src/rust/iced-x86-py/requirements-dev.txt
- name: Build and test
shell: bash
run: ./build/build-python --no-set-rustflags --python python
#############################################################################
#############################################################################
#############################################################################
build-rust-lua:
name: Lua (${{matrix.os}})
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: bash build/ci-install-rust.sh
- name: Install StyLua
shell: bash
run: |
wget https://github.com/JohnnyMorganz/StyLua/releases/download/v0.15.3/stylua-linux-x86_64.zip
mkdir /tmp/bin
unzip stylua-*.zip -d /tmp/bin
- name: Install Lua and luarocks
shell: bash
run: |
sudo apt-get install -y lua5.1 lua5.2 lua5.3 lua5.4 liblua5.1-0-dev liblua5.2-dev liblua5.3-dev liblua5.4-dev luarocks
sudo luarocks --lua-version 5.1 install busted
sudo luarocks --lua-version 5.2 install busted
sudo luarocks --lua-version 5.3 install busted
sudo luarocks --lua-version 5.4 install busted
- name: Build and test
shell: bash
run: |
export PATH=$PATH:/tmp/bin
./build/build-lua --no-set-rustflags --quick-check