-
Notifications
You must be signed in to change notification settings - Fork 5
334 lines (321 loc) · 11.5 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
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
name: CI
on:
pull_request:
push:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-ci-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt, clippy
override: true
- name: CI job
run: cargo run -p ci
working-directory: ./tools/ci
- name: Ensure docs compile
run: cargo doc --no-deps -p dexterous_developer
env:
RUSTDOCFLAGS: -Dwarnings
build-tester:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-tests-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt, clippy
override: true
- if: ${{ matrix.os == 'windows-latest' }}
name: Add Binutils
run: cargo install -f cargo-binutils
- if: ${{ matrix.os == 'windows-latest' }}
name: Add llvm
run: rustup component add llvm-tools-preview
- if: ${{ matrix.os == 'macos-latest' }}
name: Install LLVM
run: brew install --force --ignore-dependencies z3 llvm
- if: ${{ matrix.os == 'ubuntu-latest' }}
name: Dependencies
run: sudo apt-get update && sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev clang lld
- name: Build CLI
run: cargo build -p dexterous_developer_cli
- name: Build Tester
run: cargo build
working-directory: ./testing/dexterous_developer_tests
- name: Store CLI
uses: actions/upload-artifact@v3
with:
name: ${{matrix.os}}-cli
path: target/debug/dexterous_developer_cli${{ matrix.os == 'windows-latest' && '.exe' || '' }}
- name: Store Tester
uses: actions/upload-artifact@v3
with:
name: ${{matrix.os}}-tester
path: testing/dexterous_developer_tests/target/debug/run_tests${{ matrix.os == 'windows-latest' && '.exe' || '' }}
cross-builds:
needs: build-tester
strategy:
matrix:
builder:
- ubuntu-latest
target:
- os: macos-latest
target: mac
- os: windows-latest
target: windows
runs-on: ${{matrix.builder}}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-tests-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt, clippy
override: true
- run: mkdir bins
- name: Download CLI
uses: actions/download-artifact@v3
with:
name: ${{matrix.builder}}-cli
path: ${{github.workspace}}/bins
- name: Mock Versions In Cargo.toml
run: |
sed -i -e 's/version.workspace = true/version = "0.1.0"/g' ./dexterous_developer/Cargo.toml
sed -i -e 's/.*workspace = true//g' ./dexterous_developer/Cargo.toml
sed -i -e 's/version.workspace = true/version = "0.1.0"/g' ./dexterous_developer_dynamic/Cargo.toml
sed -i -e 's/.*workspace = true//g' ./dexterous_developer_dynamic/Cargo.toml
sed -i -e 's/version.workspace = true/version = "0.1.0"/g' ./dexterous_developer_internal/Cargo.toml
sed -i -e 's/.*workspace = true//g' ./dexterous_developer_internal/Cargo.toml
sed -i -e 's/version.workspace = true/version = "0.1.0"/g' ./dexterous_developer_macros/Cargo.toml
sed -i -e 's/.*workspace = true//g' ./dexterous_developer_macros/Cargo.toml
- name: Set Executable
run: chmod +x ./bins/*
- run: ${{github.workspace}}/bins/dexterous_developer_cli install-cross ${{matrix.target.target}} --macos-sdk-url ${{secrets.MAC_SDK_URL}}
- run: ${{github.workspace}}/bins/dexterous_developer_cli compile-libs --target ${{matrix.target.target}} ${{github.workspace}}/libs
working-directory: testing/templates/simple_cli_test
env:
RUST_LOG: dexterous_developer_internal=trace
- name: Store Libs
uses: actions/upload-artifact@v3
with:
name: ${{matrix.target.os}}-${{matrix.builder}}-test-libs
path: ${{github.workspace}}/libs
cross-build-runs:
needs: cross-builds
strategy:
matrix:
builder:
- ubuntu-latest
target:
- os: macos-latest
target: mac
- os: windows-latest
target: windows
runs-on: ${{matrix.target.os}}
steps:
- uses: msys2/setup-msys2@v2
if: ${{ matrix.target.os == 'windows-latest' }}
- run: mkdir bins
- name: Download CLI
uses: actions/download-artifact@v3
with:
name: ${{matrix.target.os}}-cli
path: ${{github.workspace}}/bins
- name: Download Tester
uses: actions/download-artifact@v3
with:
name: ${{matrix.target.os}}-tester
path: ${{github.workspace}}/bins
- name: Set Executable
run: chmod +x ./bins/*
- name: Download Libs
uses: actions/download-artifact@v3
with:
name: ${{matrix.target.os}}-${{matrix.builder}}-test-libs
path: ${{github.workspace}}/libs
- name: Run Compiled Artifact
run: bins/run_tests${{ matrix.target.os == 'windows-latest' && '.exe' || '' }} existing ${{github.workspace}}/libs
env:
DEXTEROUS_CLI_PATH: ${{github.workspace}}/bins/dexterous_developer_cli
DEXTEROUS_TESTER_PATH: ${{github.workspace}}/testing
RUST_LOG: dexterous_developer_internal=trace
tests:
needs: build-tester
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
test:
[
cold,
hot,
edit,
launcher,
initialize_resource,
update_resource,
reset_resource,
reset_resource_to_value,
resource_schema,
insert_components,
component_schema,
clear_on_reload,
setup_on_reload,
setup_in_state,
replacable_state,
update_reloadable_event,
remote,
asset,
]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-tests-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt, clippy
override: true
- if: ${{ matrix.os == 'windows-latest' }}
name: Add Binutils
run: cargo install -f cargo-binutils
- if: ${{ matrix.os == 'windows-latest' }}
name: Add llvm
run: rustup component add llvm-tools-preview
- if: ${{ matrix.os == 'macos-latest' }}
name: Install LLVM
run: brew install --force --ignore-dependencies z3 llvm
- if: ${{ matrix.os == 'ubuntu-latest' }}
name: Dependencies
run: sudo apt-get update && sudo apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev clang lld
- run: mkdir bins
- name: Download CLI
uses: actions/download-artifact@v3
with:
name: ${{matrix.os}}-cli
path: ${{github.workspace}}/bins
- name: Download Tester
uses: actions/download-artifact@v3
with:
name: ${{matrix.os}}-tester
path: ${{github.workspace}}/bins
- name: Set Executable
run: chmod +x ./bins/*
- name: Run Test - ${{matrix.test}}
run: bins/run_tests${{ matrix.os == 'windows-latest' && '.exe' || '' }} ${{matrix.test}}
env:
DEXTEROUS_CLI_PATH: ${{github.workspace}}/bins/dexterous_developer_cli
DEXTEROUS_TESTER_PATH: ${{github.workspace}}/testing
RUST_LOG: dexterous_developer_internal=trace
mdbook:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "latest"
- run: mdbook build
check-markdown-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check dead links
continue-on-error: true
id: run1
uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976
with:
use-quiet-mode: "yes"
use-verbose-mode: "yes"
config-file: ".github/linters/markdown-link-check.json"
- name: Sleep for 30 seconds
if: steps.run1.outcome=='failure'
run: sleep 30s
shell: bash
- name: check dead links (retry)
continue-on-error: true
id: run2
if: steps.run1.outcome=='failure'
uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976
with:
use-quiet-mode: "yes"
use-verbose-mode: "yes"
config-file: ".github/linters/markdown-link-check.json"
- name: Sleep for 30 seconds
if: steps.run2.outcome=='failure'
run: sleep 30s
shell: bash
- name: check dead links (retry 2)
continue-on-error: true
id: run3
if: steps.run2.outcome=='failure'
uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976
with:
use-quiet-mode: "yes"
use-verbose-mode: "yes"
config-file: ".github/linters/markdown-link-check.json"
- name: set the status
if: always()
run: |
if ${{ steps.run1.outcome=='success' || steps.run2.outcome=='success' || steps.run3.outcome=='success' }}; then
echo success
else
exit 1
fi
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Run Markdown Lint
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: true
DEFAULT_BRANCH: main