Skip to content

Commit a85877a

Browse files
h-a-n-aCopilot
andauthored
ci(native-watcher): test multiple platforms (#12197)
* ci(native-watcher): test multiple platforms * Update .github/workflows/reusable-rust-test.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: update name --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f3947a7 commit a85877a

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

.github/workflows/reusable-rust-test.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,58 @@ jobs:
140140
--exclude rspack_binding_builder_testing \
141141
--exclude rspack_binding_build \
142142
--exclude rspack_napi \
143+
--exclude rspack_watcher \
143144
-- --nocapture
144145
146+
rust_watcher_test:
147+
name: Rust watcher test - ${{ matrix.array.runner }}
148+
runs-on: ${{ fromJSON(matrix.array.runner) }}
149+
strategy:
150+
fail-fast: false # run all tests even if some fail
151+
matrix:
152+
array:
153+
- runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
154+
- runner: ${{ '"windows-latest"' }}
155+
- runner: ${{ '"macos-latest"' }}
156+
needs: [check-changed]
157+
if: ${{ needs.check-changed.outputs.code_changed == 'true' }}
158+
steps:
159+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
160+
161+
- name: Install Rust Toolchain
162+
uses: ./.github/actions/rustup
163+
with:
164+
save-if: true
165+
key: test-os-${{ matrix.array.runner }}
166+
167+
# Compile test without debug info for reducing the CI cache size
168+
- name: Change profile.test
169+
shell: bash
170+
run: |
171+
echo '[profile.test]' >> Cargo.toml
172+
echo 'debug = false' >> Cargo.toml
173+
174+
- name: Run rspack test
175+
run: |
176+
cargo test -p rspack_watcher -- --nocapture
177+
145178
test_required_check:
146179
name: Rust Test Required Check
147-
needs: [rust_test, rust_check, rust_unused_dependencies, check-changed]
180+
needs:
181+
[
182+
rust_test,
183+
rust_check,
184+
rust_unused_dependencies,
185+
rust_watcher_test,
186+
check-changed
187+
]
148188
if: ${{ always() && !cancelled() }}
149189
runs-on: ubuntu-latest
150190
steps:
151191
- name: Log
152192
run: echo ${{ join(needs.*.result, ',') }}
153193
- name: Test check
154-
if: ${{ needs.check-changed.outputs.code_changed == 'true' && join(needs.*.result, ',')!='success,success,success,success' }}
194+
if: ${{ needs.check-changed.outputs.code_changed == 'true' && join(needs.*.result, ',')!='success,success,success,success,success' }}
155195
run: echo "Tests Failed" && exit 1
156196
- name: No check to Run test
157197
run: echo "Success"

0 commit comments

Comments
 (0)