1- name : Cargo
1+ name : CI
22
33on :
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' }}"
613
714env :
815 RUST_LOG : debug
916 CARGO_INCREMENTAL : 0
1017 CI : " 1"
1118
1219jobs :
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 :
1471 strategy :
1572 fail-fast : false
1673 matrix :
@@ -56,12 +113,12 @@ jobs:
56113 run : |
57114 cargo test --all --color always
58115
59- publish :
116+ cargo- publish :
60117 name : " Publish"
61118 runs-on : ubuntu-latest
62119 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
63120 needs :
64- - test
121+ - cargo- test
65122
66123 steps :
67124 - uses : actions/checkout@v2
@@ -86,3 +143,15 @@ jobs:
86143 CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
87144 run : |
88145 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