Files
Boshen 17a3aad5a7 perf(ci): parallelize independent workflow steps (#27476)
## Summary

- run independent setup, cache, artifact, and release preparation steps in parallel
- keep producer/consumer chains and shared-cache operations sequential
- apply grouping-only changes across CI, maintenance, and release workflows
- pin security-action v1.0.9 and restrict GitHub App tokens to required permissions
- use dedicated `$/.github/...` references for local actions and workflows

## CI timing

Measured from GitHub job timestamps on 2026-10-09. Setup-stage comparisons are used where the test workload differs between runs.

| Path | Sequential | Parallel | Difference |
| --- | ---: | ---: | ---: |
| Autofix job | 75–78 s | 51 s | 24–27 s faster (32–35%) |
| NAPI Compiler setup | 52 s | 36 s | 16 s faster (31%) |
| Codegen setup | 53 s | 38 s | 15 s faster (28%) |
| Lexer setup | 40–42 s | 26–28 s | 14 s faster (33–35%) |

The lexer baseline is the sum of the same run child-step durations; the other rows compare parallel runs with sequential workflow runs.

The [latest CI workflow](https://github.com/oxc-project/oxc/actions/runs/37891107675) completed in 5m24s. Its unchanged WASM job was the critical path at 5m08s, so this run demonstrates lower affected-job latency and runner time, but no material end-to-end workflow reduction.

Timing sources: [parallel autofix](https://github.com/oxc-project/oxc/actions/runs/37891107670), [sequential autofix A](https://github.com/oxc-project/oxc/actions/runs/37891199647), [sequential autofix B](https://github.com/oxc-project/oxc/actions/runs/37891193640), [sequential NAPI Compiler](https://github.com/oxc-project/oxc/actions/runs/37846341918), and [sequential Codegen](https://github.com/oxc-project/oxc/actions/runs/37815684125).

## Validation

- parsed every changed workflow as YAML
- verified all 31 parallel groups contain valid steps
- compared flattened workflows against main to confirm no steps or settings changed
- ran `zizmor .github` with zero findings
- passed the Security Analysis workflow
- ran `git diff --check`

Uses the GitHub Actions parallel steps feature: https://github.blog/changelog/2026-06-25-actions-steps-can-now-be-run-in-parallel/

## AI assistance

AI assistance was used to audit, implement, validate, and measure these workflow changes. The contributor remains responsible for reviewing and understanding the changes before merge.
2026-10-09 06:24:44 +00:00

51 lines
1.6 KiB
YAML

name: autofix.ci # For security reasons, the workflow in which the autofix.ci action is used must be named "autofix.ci".
permissions: {}
on:
pull_request:
types: [opened, synchronize]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- parallel:
- uses: oxc-project/setup-node@f46a72f95efdc55273fcd042d61c84e723b2892c # v1.4.1
- uses: oxc-project/setup-rust@3d6fb132fbe7cdcb66bf8ec193911c2945369d12 # v1.0.17
with:
restore-cache: true
cache-key: warm
tools: just,cargo-shear@1.13.1
components: rustfmt
- name: cargo-shear
id: shear
shell: bash
run: |
if ! cargo shear --fix --check-test-targets --deny-warnings --format=github; then
echo "shear=true" >> $GITHUB_OUTPUT
fi
- name: Check and update lock file
run: cargo check --all-features --all-targets
if: ${{ steps.shear.outputs.shear == 'true' }}
- run: just fmt
- name: Verify no fixes are needed
if: ${{ github.event_name == 'merge_group' }}
run: git diff --exit-code
- uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a # v1.3.4
if: ${{ github.event_name == 'pull_request' }}
with:
fail-fast: false