fix(minifier): preserve var inside catch with same-named parameter
#85743
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| permissions: {} | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: [opened, synchronize] | |
| branches-ignore: | |
| - "**/graphite-base/**" | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: ${{ github.ref_name != 'main' }} | |
| jobs: | |
| test-ubuntu: | |
| name: Test Linux | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| with: | |
| path: /home/runner/.rustup | |
| cache: | | |
| rust | |
| pnpm | |
| - run: cargo ck | |
| - run: cargo test --all-features | |
| - run: git diff --exit-code # Must commit everything | |
| test-ubuntu-aarch64: | |
| if: ${{ github.ref_name == 'main' }} | |
| name: Test Linux ARM64 | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| - uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16 | |
| with: | |
| save-cache: ${{ github.ref_name == 'main' }} | |
| cache-key: warm-aarch64 | |
| - run: cargo ck | |
| - run: cargo test --all-features | |
| - run: git diff --exit-code # Must commit everything | |
| test-mac: # Separate job to save a job on PRs | |
| if: ${{ github.ref_name == 'main' }} | |
| name: Test Mac | |
| runs-on: namespace-profile-mac-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| with: | |
| cache: | | |
| rust | |
| pnpm | |
| - run: cargo ck | |
| - run: cargo test --all-features | |
| - run: git diff --exit-code # Must commit everything | |
| test-windows: | |
| if: ${{ github.ref_name == 'main' }} | |
| name: Test Windows | |
| runs-on: windows-latest | |
| steps: | |
| - run: git config --system core.longpaths true | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| # Unsung heroes of the internet, who led me here to speed up Windows' slowness: | |
| # https://github.com/actions/cache/issues/752#issuecomment-1847036770 | |
| # https://github.com/astral-sh/uv/blob/502e04200d52de30d3159894833b3db4f0d6644d/.github/workflows/ci.yml#L158 | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| - uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0 | |
| with: | |
| workspace-copy: true | |
| drive-size: 12GB | |
| drive-format: ReFS | |
| env-mapping: | | |
| CARGO_HOME,{{ DEV_DRIVE }}/.cargo | |
| RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup | |
| - name: Install Rust | |
| working-directory: ${{ env.DEV_DRIVE_WORKSPACE }} | |
| shell: bash | |
| run: | | |
| # This `awk` command will find the value of our Minimum Supported Rust Version and store it as `MSRV`. | |
| # NOTE: this will fail if there are any other items named `rust-version`. We assume there is only one in our `Cargo.toml`. | |
| MSRV=$(awk -F'=' '/rust-version/ {gsub(/[" ]/, "", $2); printf "%s", ($2 + "")}' Cargo.toml) | |
| # Set profile to minimal and channel to our Minimum Supported Rust Version. | |
| # Running our tests on this channel ensures that our code uses APIs that are supported in our `MSRV`. | |
| sed -i -e 's/profile = "default"/profile = "minimal"/g' -e "s/channel = .*/channel = \"$MSRV\"/g" rust-toolchain.toml | |
| rustup set profile minimal | |
| rustup show | |
| git restore . | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| workspaces: ${{ env.DEV_DRIVE_WORKSPACE }} | |
| save-if: ${{ github.ref_name == 'main' }} | |
| shared-key: windows-latest | |
| - name: Run tests | |
| # No need for `cargo ck` because it's already checked in linux | |
| # Run `website` tests separately to avoid feature unification problems with `oxlint` | |
| run: cargo test --all-features | |
| working-directory: ${{ env.DEV_DRIVE_WORKSPACE }} | |
| shell: bash | |
| test-big-endian: | |
| if: ${{ github.ref_name == 'main' }} | |
| name: Test big-endian # s390x-unknown-linux-gnu is a big-endian | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| with: | |
| path: /home/runner/.rustup | |
| cache: rust | |
| - uses: taiki-e/install-action@fd0f63e180a477d7434580b6d80817978b9ff2b8 # v2.70.1 | |
| with: | |
| tool: cross | |
| # `--lib --bins --tests` to skip doctests which are very slow to run via `cross`. | |
| # https://github.com/cross-rs/cross/issues/1703 | |
| - run: cross test --lib --bins --tests --all-features --target s390x-unknown-linux-gnu | |
| test-32bit: | |
| if: ${{ github.ref_name == 'main' }} | |
| name: Test 32-bit # armv7-unknown-linux-gnueabihf is a 32-bit target | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| with: | |
| path: /home/runner/.rustup | |
| cache: rust | |
| - uses: taiki-e/install-action@fd0f63e180a477d7434580b6d80817978b9ff2b8 # v2.70.1 | |
| with: | |
| tool: cross | |
| # `--lib --bins --tests` to skip doctests which are very slow to run via `cross`. | |
| # https://github.com/cross-rs/cross/issues/1703 | |
| - run: cross test --workspace --lib --bins --tests --all-features --exclude oxc_language_server --exclude oxc_linter --exclude oxlint --target armv7-unknown-linux-gnueabihf | |
| test-wasm32-wasip1-threads: | |
| name: Test wasm32-wasip1-threads | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: ./.github/actions/check-changes | |
| id: filter | |
| with: | |
| exclude: oxc_linter | |
| paths: napi/,npm/,apps/,pnpm-lock.yaml,package.json | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| path: /home/runner/.rustup | |
| cache: | | |
| rust | |
| pnpm | |
| - name: Build | |
| if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| rustup target add wasm32-wasip1-threads | |
| pnpm run build-wasm-dev | |
| git diff --exit-code # Must commit everything | |
| - name: Test wasi in browser | |
| if: steps.filter.outputs.changed == 'true' | |
| working-directory: napi/parser | |
| run: | | |
| rm -rf *.wasm | |
| pnpm exec playwright install chromium | |
| pnpm run build-wasi | |
| pnpm run build-wasm-dev | |
| pnpm run build-npm-dir | |
| pnpm run test-browser | |
| pnpm build-browser-bundle --npmDir npm-dir | |
| test-napi-compiler: | |
| name: Test NAPI Compiler | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: ./.github/actions/check-changes | |
| id: filter | |
| with: | |
| exclude: oxc_linter,oxc_language_server | |
| paths: napi/parser/,napi/minify/,napi/transform/,npm/oxc-types/,npm/runtime/,tasks/e2e/,pnpm-lock.yaml,package.json | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| path: /home/runner/.rustup | |
| cache: | | |
| rust | |
| pnpm | |
| - uses: ./.github/actions/clone-submodules | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| babel: false | |
| prettier: false | |
| node-compat-table: false | |
| - if: steps.filter.outputs.changed == 'true' | |
| name: Run tests | |
| env: | |
| RUN_RAW_RANGE_TESTS: "true" | |
| RUN_RAW_TOKENS_TESTS: "true" | |
| run: | | |
| pnpm --workspace-concurrency=1 --filter "./napi/parser" --filter "./napi/minify" --filter "./napi/transform" build-test | |
| pnpm --workspace-concurrency=1 --filter "./napi/parser" --filter "./napi/minify" --filter "./napi/transform" test | |
| - if: steps.filter.outputs.changed == 'true' | |
| name: Run e2e tests | |
| working-directory: tasks/e2e | |
| run: pnpm run test | |
| - if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| git diff --exit-code # Must commit everything | |
| test-napi-oxlint: | |
| name: Test NAPI Oxlint | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: ./.github/actions/check-changes | |
| id: filter | |
| with: | |
| paths: apps/oxlint/,npm/oxlint/,npm/oxlint-plugin-eslint/,npm/oxlint-plugins/,npm/oxc-types/,pnpm-lock.yaml,package.json | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| path: /home/runner/.rustup | |
| cache: | | |
| rust | |
| pnpm | |
| - if: steps.filter.outputs.changed == 'true' | |
| name: Run tests | |
| run: | | |
| pnpm --filter "./apps/oxlint" build-test | |
| pnpm --filter "./apps/oxlint" test | |
| - if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| git diff --exit-code # Must commit everything | |
| test-napi-oxfmt: | |
| name: Test NAPI Oxfmt | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: ./.github/actions/check-changes | |
| id: filter | |
| with: | |
| paths: apps/oxfmt/,npm/oxfmt/,pnpm-lock.yaml,package.json | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| path: /home/runner/.rustup | |
| cache: | | |
| rust | |
| pnpm | |
| - if: steps.filter.outputs.changed == 'true' | |
| name: Run tests | |
| run: | | |
| pnpm --filter "./apps/oxfmt" build-test | |
| pnpm --filter "./apps/oxfmt" test | |
| - if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| git diff --exit-code # Must commit everything | |
| test-napi-compiler-windows: | |
| name: Test NAPI Compiler (windows) | |
| runs-on: windows-latest | |
| if: ${{ github.ref_name == 'main' }} | |
| steps: | |
| - run: git config --system core.longpaths true | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: ./.github/actions/check-changes | |
| id: filter | |
| with: | |
| exclude: oxc_linter,oxc_language_server | |
| paths: napi/parser/,napi/minify/,napi/transform/,npm/oxc-types/,npm/runtime/,tasks/e2e/,pnpm-lock.yaml,package.json | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| - uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| workspace-copy: true | |
| drive-size: 12GB | |
| drive-format: ReFS | |
| env-mapping: | | |
| CARGO_HOME,{{ DEV_DRIVE }}/.cargo | |
| RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup | |
| - uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| cache-key: napi | |
| save-cache: ${{ github.ref_name == 'main' }} | |
| - uses: ./.github/actions/clone-submodules | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| babel: false | |
| prettier: false | |
| node-compat-table: false | |
| - if: steps.filter.outputs.changed == 'true' | |
| name: Run tests | |
| working-directory: ${{ env.DEV_DRIVE_WORKSPACE }} | |
| env: | |
| RUN_RAW_RANGE_TESTS: "true" | |
| run: | | |
| pnpm --workspace-concurrency=1 --filter "./napi/parser" --filter "./napi/minify" --filter "./napi/transform" build-test | |
| pnpm --workspace-concurrency=1 --filter "./napi/parser" --filter "./napi/minify" --filter "./napi/transform" test | |
| - if: steps.filter.outputs.changed == 'true' | |
| name: Run e2e tests | |
| working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}/tasks/e2e | |
| run: | | |
| pnpm install --frozen-lockfile | |
| pnpm run test | |
| - if: steps.filter.outputs.changed == 'true' | |
| working-directory: ${{ env.DEV_DRIVE_WORKSPACE }} | |
| run: | | |
| git diff --exit-code # Must commit everything | |
| test-napi-oxlint-windows: | |
| name: Test NAPI Oxlint (windows) | |
| runs-on: windows-latest | |
| if: ${{ github.ref_name == 'main' }} | |
| steps: | |
| - run: git config --system core.longpaths true | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: ./.github/actions/check-changes | |
| id: filter | |
| with: | |
| paths: apps/oxlint/,npm/oxlint/,npm/oxlint-plugin-eslint/,npm/oxlint-plugins/,npm/oxc-types/,pnpm-lock.yaml,package.json | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| - uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| workspace-copy: true | |
| drive-size: 12GB | |
| drive-format: ReFS | |
| env-mapping: | | |
| CARGO_HOME,{{ DEV_DRIVE }}/.cargo | |
| RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup | |
| - uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| cache-key: napi | |
| save-cache: ${{ github.ref_name == 'main' }} | |
| - if: steps.filter.outputs.changed == 'true' | |
| name: Run tests | |
| working-directory: ${{ env.DEV_DRIVE_WORKSPACE }} | |
| run: | | |
| pnpm --filter "./apps/oxlint" build-test | |
| pnpm --filter "./apps/oxlint" test | |
| - if: steps.filter.outputs.changed == 'true' | |
| working-directory: ${{ env.DEV_DRIVE_WORKSPACE }} | |
| run: | | |
| git diff --exit-code # Must commit everything | |
| test-napi-oxfmt-windows: | |
| name: Test NAPI Oxfmt (windows) | |
| runs-on: windows-latest | |
| if: ${{ github.ref_name == 'main' }} | |
| steps: | |
| - run: git config --system core.longpaths true | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: ./.github/actions/check-changes | |
| id: filter | |
| with: | |
| paths: apps/oxfmt/,npm/oxfmt/,pnpm-lock.yaml,package.json | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| - uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| workspace-copy: true | |
| drive-size: 12GB | |
| drive-format: ReFS | |
| env-mapping: | | |
| CARGO_HOME,{{ DEV_DRIVE }}/.cargo | |
| RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup | |
| - uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| cache-key: napi | |
| save-cache: ${{ github.ref_name == 'main' }} | |
| - if: steps.filter.outputs.changed == 'true' | |
| name: Run tests | |
| working-directory: ${{ env.DEV_DRIVE_WORKSPACE }} | |
| run: | | |
| pnpm --filter "./apps/oxfmt" build-test | |
| pnpm --filter "./apps/oxfmt" test | |
| - if: steps.filter.outputs.changed == 'true' | |
| working-directory: ${{ env.DEV_DRIVE_WORKSPACE }} | |
| run: | | |
| git diff --exit-code # Must commit everything | |
| typos: | |
| name: Spell Check | |
| runs-on: ubuntu-slim | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: crate-ci/typos@631208b7aac2daa8b707f55e7331f9112b0e062d # v1.44.0 | |
| with: | |
| files: . | |
| lint: | |
| name: Lint | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| with: | |
| path: /home/runner/.rustup | |
| cache: | | |
| rust | |
| pnpm | |
| - run: rustup component add clippy | |
| - run: cargo lint -- -D warnings | |
| - run: cargo lint --profile dev-no-debug-assertions -- -D warnings | |
| - run: pnpm --filter oxlint-app build-js | |
| - run: pnpm --filter oxfmt-app build-js | |
| - run: node --run lint | |
| doc: | |
| name: Doc | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| with: | |
| path: /home/runner/.rustup | |
| cache: rust | |
| - run: rustup toolchain install nightly --profile minimal --component rust-docs | |
| # https://github.com/rust-lang/rust/issues/146895 | |
| - run: RUSTDOCFLAGS='-D warnings' cargo +nightly doc --no-deps --document-private-items -Zrustdoc-mergeable-info | |
| conformance: | |
| name: Conformance | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - name: Check if conformance should run | |
| id: filter | |
| uses: ./.github/actions/check-changes | |
| with: | |
| packages: oxc_coverage,oxc_transform_conformance,oxc_prettier_conformance | |
| paths: tasks/coverage/,tasks/common/,tasks/oxc_transform_conformance/,tasks/oxc_prettier_conformance/,pnpm-lock.yaml | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: ./.github/actions/clone-submodules | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| node-compat-table: false | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| if: steps.filter.outputs.changed == 'true' | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| path: /home/runner/.rustup | |
| cache: | | |
| rust | |
| pnpm | |
| - uses: taiki-e/install-action@fd0f63e180a477d7434580b6d80817978b9ff2b8 # v2.70.1 | |
| if: steps.filter.outputs.changed == 'true' | |
| with: | |
| tool: just | |
| - name: Check Conformance | |
| if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| just update-transformer-fixtures | |
| just coverage | |
| git diff --exit-code | |
| minification: | |
| name: Minification Size | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: ./.github/actions/check-changes | |
| id: filter | |
| with: | |
| packages: oxc_minsize | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| with: | |
| path: /home/runner/.rustup | |
| cache: rust | |
| - name: Check minification size | |
| if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| cargo minsize | |
| git diff --exit-code | |
| allocs: | |
| name: Allocations | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: ./.github/actions/check-changes | |
| id: filter | |
| with: | |
| packages: oxc_track_memory_allocations | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| with: | |
| path: /home/runner/.rustup | |
| cache: rust | |
| - name: Check allocations | |
| if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| cargo allocs | |
| git diff --exit-code || | |
| (echo 'Allocations have changed. Run the `cargo allocs` command to update the allocation snapshot, otherwise please fix the regression.' && exit 1) | |
| ast_changes: | |
| name: AST Changes | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: filter | |
| with: | |
| filters: ".github/generated/ast_changes_watch_list.yml" | |
| - uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0 | |
| if: steps.filter.outputs.src == 'true' | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| if: steps.filter.outputs.src == 'true' | |
| with: | |
| path: /home/runner/.rustup | |
| cache: | | |
| rust | |
| pnpm | |
| - run: rustup component add rustfmt | |
| if: steps.filter.outputs.src == 'true' | |
| - name: Check AST Changes | |
| if: steps.filter.outputs.src == 'true' | |
| run: | | |
| cargo run -p oxc_ast_tools | |
| git diff --exit-code || | |
| (echo 'AST changes caused the "generated" code to get outdated. Have you forgotten to run the `just ast` command and/or commit generated codes?' && exit 1) | |
| lintgen: | |
| name: Linter changes | |
| runs-on: namespace-profile-linux-x64-default | |
| steps: | |
| - uses: taiki-e/checkout-action@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1 | |
| - uses: ./.github/actions/check-changes | |
| id: filter | |
| with: | |
| packages: oxc_linter | |
| paths: tasks/linter_codegen/ | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| pr-number: ${{ github.event.pull_request.number }} | |
| - uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2 | |
| with: | |
| path: /home/runner/.rustup | |
| cache: rust | |
| - run: rustup component add rustfmt | |
| if: steps.filter.outputs.changed == 'true' | |
| - name: Check linter changes | |
| if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| cargo lintgen | |
| git diff --exit-code || | |
| (echo 'Linter codegen has changed. Run the `cargo lintgen` command to update the linter code generated and commit it.' && exit 1) |