chore(ci): Add miri tests (#8847)

It can help to find some UB in swc
This commit is contained in:
LongYinan 2024-04-12 11:59:25 +08:00 committed by GitHub
parent a5d1e579cb
commit b0df6e5341
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -853,6 +853,53 @@ jobs:
export NODE_OPTIONS="--unhandled-rejections=warn"
(cd crates/swc_node_bundler/tests/integration/react && npm install && npx spack)
miri:
name: Miri
runs-on: ubuntu-latest
if: >-
${{ !contains(github.event.head_commit.message, 'chore: ') }}
strategy:
fail-fast: false
matrix:
crate:
- better_scoped_tls
- string_enum
- swc
- swc_bundler
- swc_ecma_codegen
- swc_ecma_minifier
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"
- name: Install node dependencies
shell: bash
run: yarn
- name: Print rustup toolchain version
shell: bash
id: rustup-version
run: |
export RUST_TOOLCHAIN="$(cat rust-toolchain | tr -d '\n')"
echo "Rust toolchain: $RUST_TOOLCHAIN"
echo "RUST_TOOLCHAIN=$RUST_TOOLCHAIN" >> "$GITHUB_OUTPUT"
- name: Install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "${{ steps.rustup-version.outputs.RUST_TOOLCHAIN }}"
components: miri
- run: cargo miri test -p ${{ matrix.crate }} --no-fail-fast
continue-on-error: true
env:
MIRIFLAGS: "-Zmiri-disable-isolation"
done:
needs:
- cargo-fmt