Files
oxc-project__oxc/.github/workflows/miri.yml
camc314 3d0de4e2a1 perf(ci): skip Miri cache setup when checks are skipped (#26401)
Skip Namespace Rust cache setup when change detection skips the Miri checks, avoiding unnecessary cache initialization.
2026-09-07 14:54:56 +00:00

72 lines
2.3 KiB
YAML

name: Miri
permissions: {}
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
paths:
- "crates/oxc_allocator/**"
- "crates/oxc_ast/src/utf8_to_utf16.rs"
- "crates/oxc_ast/src/generated/utf8_to_utf16_converter.rs"
- "crates/oxc_data_structures/**"
- "crates/oxc_parser/**"
- "crates/oxc_traverse/**"
- ".github/workflows/miri.yml"
push:
branches:
- main
paths:
- "crates/oxc_allocator/**"
- "crates/oxc_ast/src/utf8_to_utf16.rs"
- "crates/oxc_ast/src/generated/utf8_to_utf16_converter.rs"
- "crates/oxc_data_structures/**"
- "crates/oxc_parser/**"
- "crates/oxc_traverse/**"
- ".github/workflows/miri.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
miri:
name: Miri
runs-on: namespace-profile-linux-x64-default
env:
# Pin Miri to a known-good nightly.
MIRI_TOOLCHAIN: nightly-2026-05-01
steps:
- name: Checkout
uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- uses: ./.github/actions/check-changes
id: filter
with:
packages: oxc_allocator,oxc_ast,oxc_data_structures,oxc_parser,oxc_transformer
paths: .github/workflows/miri.yml
token: ${{ secrets.GITHUB_TOKEN }}
pr-number: ${{ github.event.pull_request.number }}
- uses: namespacelabs/nscloud-cache-action@c5f8dab7560444c4bf8dbc64f1b203431873c547 # v1.6.1
if: steps.filter.outputs.changed == 'true'
with:
path: /home/runner/.rustup
cache: rust
- name: Install Miri
if: steps.filter.outputs.changed == 'true'
run: |
rustup toolchain install "${MIRI_TOOLCHAIN}" --component miri
cargo +"${MIRI_TOOLCHAIN}" miri setup
- name: Test with Miri
if: steps.filter.outputs.changed == 'true'
# Enable strict provenance checks
env:
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-disable-isolation
run: |
cargo +"${MIRI_TOOLCHAIN}" miri test --all-features -p oxc_allocator -p oxc_ast -p oxc_data_structures
cargo +"${MIRI_TOOLCHAIN}" miri test -p oxc_parser -p oxc_transformer