1
- name : Cargo
1
+ name : CI
2
2
3
3
on :
4
- - push
5
- - pull_request
4
+ pull_request :
5
+ types : ["opened", "reopened", "synchronize"]
6
+ push :
7
+ branches :
8
+ - main
9
+
10
+ concurrency :
11
+ group : ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress : " ${{ github.event_name == 'pull_request' }}"
6
13
7
14
env :
8
15
RUST_LOG : debug
9
16
CARGO_INCREMENTAL : 0
10
17
CI : " 1"
11
18
12
19
jobs :
13
- test :
20
+ npm-test :
21
+ name : " Integration Test"
22
+ runs-on : ubuntu-latest
23
+ steps :
24
+ - uses : actions/checkout@v4
25
+
26
+ - name : Setup node
27
+ uses : actions/setup-node@v2
28
+ with :
29
+ node-version : 20
30
+
31
+ - name : Install Rust
32
+ uses : actions-rs/toolchain@v1
33
+ with :
34
+ profile : minimal
35
+ override : true
36
+
37
+ - name : Configure path (windows)
38
+ shell : bash
39
+ if : runner.os == 'Windows'
40
+ run : |
41
+ echo 'C:\\npm\\prefix' >> $GITHUB_PATH
42
+
43
+ - uses : Swatinem/rust-cache@v2
44
+ with :
45
+ shared-key : " npm-test"
46
+ cache-on-failure : true
47
+
48
+ - run : |
49
+ echo "Before: corepack version => $(corepack --version || echo 'not installed')"
50
+ npm install -g corepack@latest
51
+ echo "After : corepack version => $(corepack --version)"
52
+ corepack enable
53
+ pnpm --version
54
+ pnpm i
55
+
56
+ - name : Install Rust
57
+ uses : actions-rs/toolchain@v1
58
+ with :
59
+ profile : minimal
60
+
61
+ - name : Install wasm target
62
+ shell : bash
63
+ run : |
64
+ rustup target add wasm32-wasip1
65
+
66
+ - name : Test
67
+ run : |
68
+ pnpm test
69
+
70
+ cargo-test :
14
71
strategy :
15
72
fail-fast : false
16
73
matrix :
@@ -56,12 +113,12 @@ jobs:
56
113
run : |
57
114
cargo test --all --color always
58
115
59
- publish :
116
+ cargo- publish :
60
117
name : " Publish"
61
118
runs-on : ubuntu-latest
62
119
if : github.event_name == 'push' && github.ref == 'refs/heads/main'
63
120
needs :
64
- - test
121
+ - cargo- test
65
122
66
123
steps :
67
124
- uses : actions/checkout@v2
@@ -86,3 +143,15 @@ jobs:
86
143
CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
87
144
run : |
88
145
cargo mono publish --no-verify
146
+
147
+ done :
148
+ needs :
149
+ - npm-test
150
+ - cargo-test
151
+ if : >-
152
+ ${{ always() }}
153
+ runs-on : ubuntu-latest
154
+ name : Done
155
+ steps :
156
+ - run : exit 1
157
+ if : ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')) }}
0 commit comments