name: Bless Test262 ledger
on:
workflow_dispatch:
inputs:
ref:
description: Branch to bless (default master)
required: false
default: master
permissions:
contents: write
jobs:
bless:
name: Regenerate tests/test262-status.txt
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.ref }}
submodules: recursive
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
persist-credentials: true
- name: Fetch the intl crate (path-dependency sibling)
run: git clone --depth 1 https://github.com/KarpelesLab/intlrs.git ../unicoders
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Re-bless the ledger
env:
KATAAN_TEST262_BLESS: "1"
run: cargo test --release --test test262_official -- --ignored --nocapture
- name: Commit the regenerated ledger
run: |
if git diff --quiet -- tests/test262-status.txt; then
echo "Ledger unchanged — nothing to commit."
exit 0
fi
git config user.name "kataan-bless-bot"
git config user.email "noreply@github.com"
# Report the net change in the commit body.
before=$(git show HEAD:tests/test262-status.txt | grep -vc '^#' || true)
after=$(grep -vc '^#' tests/test262-status.txt || true)
git add tests/test262-status.txt
git commit -m "chore(test262): re-bless ledger (${before} -> ${after} known failures)
Regenerated by the bless-test262 workflow."
# The suite takes ~13 min, during which master may have advanced with
# source-only commits. The bot only touches the ledger, so rebasing the
# bless commit onto the latest tip is conflict-free; retry a few times in
# case of a concurrent push.
for attempt in 1 2 3 4 5; do
git fetch origin "${{ github.event.inputs.ref }}"
git rebase "origin/${{ github.event.inputs.ref }}" || { git rebase --abort; exit 1; }
if git push origin "HEAD:${{ github.event.inputs.ref }}"; then
echo "Pushed on attempt $attempt."; exit 0
fi
echo "Push rejected (attempt $attempt) — refetching and retrying."
sleep 5
done
echo "Failed to push the re-blessed ledger after retries." >&2
exit 1