Socket syscall fault injection for net/tls/http/http2/fetch/WebSocket fuzzing + 6 bug fixes #49845
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: autofix.ci | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_call: | |
| workflow_dispatch: | |
| pull_request: | |
| merge_group: | |
| env: | |
| BUN_VERSION: "1.3.2" | |
| LLVM_VERSION: "21.1.8" | |
| LLVM_VERSION_MAJOR: "21" | |
| jobs: | |
| autofix: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Configure Git | |
| run: | | |
| git config --global core.autocrlf true | |
| git config --global core.ignorecase true | |
| git config --global core.precomposeUnicode true | |
| - name: Setup Bun | |
| uses: ./.github/actions/setup-bun | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Setup Dependencies | |
| run: | | |
| bun install | |
| - name: Format Code | |
| env: | |
| # Pin the toolchain explicitly so rustup ignores rust-toolchain.toml's | |
| # `targets` list (11 cross triples ≈ 450 MB of prebuilt std we don't | |
| # need just to run rustfmt). Keep this in sync with `channel` there. | |
| RUSTUP_TOOLCHAIN: nightly-2026-05-06 | |
| run: | | |
| # Without pipefail, `cmd | sed` always reports sed's exit status, so a | |
| # failing formatter is invisible to the `wait $PID` checks below. | |
| set -o pipefail | |
| # Start prettier in background with prefixed output | |
| echo "::group::Prettier" | |
| (bun run prettier 2>&1 | sed 's/^/[prettier] /') & | |
| PRETTIER_PID=$! | |
| # Start clang-format installation and formatting in background with prefixed output | |
| echo "::group::Clang-format" | |
| ( | |
| echo "[clang-format] Installing clang-format-${{ env.LLVM_VERSION_MAJOR }}..." | |
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null | |
| echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${{ env.LLVM_VERSION_MAJOR }} main" | sudo tee /etc/apt/sources.list.d/llvm.list > /dev/null | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq --no-install-recommends --no-install-suggests -o=Dpkg::Use-Pty=0 clang-format-${{ env.LLVM_VERSION_MAJOR }} | |
| echo "[clang-format] Running clang-format..." | |
| LLVM_VERSION_MAJOR=${{ env.LLVM_VERSION_MAJOR }} ./scripts/run-clang-format.sh format 2>&1 | sed 's/^/[clang-format] /' | |
| ) & | |
| CLANG_PID=$! | |
| # Run cargo fmt in background with prefixed output. RUSTUP_TOOLCHAIN | |
| # (step env) overrides rust-toolchain.toml, so install only the host | |
| # toolchain + rustfmt instead of the file's 11 cross-target std libs. | |
| echo "::group::Cargo fmt" | |
| ( | |
| echo "[rustfmt] Installing toolchain $RUSTUP_TOOLCHAIN..." | |
| rustup toolchain install "$RUSTUP_TOOLCHAIN" --profile minimal --component rustfmt --no-self-update 2>&1 | sed 's/^/[rustfmt] /' | |
| echo "[rustfmt] Running cargo fmt --all..." | |
| cargo fmt --all 2>&1 | sed 's/^/[rustfmt] /' | |
| ) & | |
| RUST_PID=$! | |
| # Wait for all formatting tasks to complete | |
| echo "" | |
| echo "Running formatters in parallel..." | |
| FAILED=0 | |
| if ! wait $PRETTIER_PID; then | |
| echo "::error::Prettier failed" | |
| FAILED=1 | |
| fi | |
| echo "::endgroup::" | |
| if ! wait $CLANG_PID; then | |
| echo "::error::Clang-format failed" | |
| FAILED=1 | |
| fi | |
| echo "::endgroup::" | |
| if ! wait $RUST_PID; then | |
| echo "::error::cargo fmt failed" | |
| FAILED=1 | |
| fi | |
| echo "::endgroup::" | |
| # Exit with error if any formatter failed | |
| if [ $FAILED -eq 1 ]; then | |
| echo "::error::One or more formatters failed" | |
| exit 1 | |
| fi | |
| echo "✅ All formatters completed successfully" | |
| - name: Ban Words | |
| run: | | |
| bun ./test/internal/ban-words.test.ts | |
| - name: Verify checked-in codegen | |
| # `*.generated.rs` are deterministic outputs of `*.string-map.ts`; the | |
| # source `.ts` is the truth. This step regenerates and fails if the | |
| # committed `.generated.rs` is stale, so a forgotten regen surfaces in | |
| # CI rather than as a confusing behaviour diff later. | |
| run: | | |
| bun run codegen:verify | |
| - uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 |