373d9c08c0
🤖 Agent: verified: OUTPUT_VERSION = 1 and output-versions.txt carry the digest measured on 10 CI preparations. tools/prepare_output.py check passes on v0.2.64's preparation and fails on v0.2.47's. This head's own parity job prepares with its preparer and checks the digest. Merging.
89 lines
3.9 KiB
YAML
89 lines
3.9 KiB
YAML
name: parity
|
|
# The vanilla harnesses a pull request's changes can affect, on the Mac mini's runner, which holds the maintainer's
|
|
# own Minecraft files (Horizon never downloads the game). Called by ci.yml for pull requests from this repository
|
|
# and by run-parity.yml when a maintainer labels a fork's pull request run-parity. See docs/release-flow.md.
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
base:
|
|
description: The pull request's base commit (the harnesses its changes since then can affect)
|
|
type: string
|
|
required: true
|
|
head:
|
|
description: The commit to check out and test
|
|
type: string
|
|
required: true
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
# Test runs never reach the telemetry server: no live-count ping, no uploads (docs/telemetry.md).
|
|
HORIZON_TELEMETRY_URL: "off"
|
|
|
|
jobs:
|
|
parity:
|
|
runs-on: [self-hosted, horizon-game]
|
|
timeout-minutes: 120 # a change to core crates reruns ~300 harnesses: ~60-90 min on the Mac mini
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
# The commit the event names: a fork's later pushes need another run-parity label.
|
|
ref: ${{ inputs.head }}
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
# Keeps .local/ (parity state, probe builds, oracle results) and target/ between runs.
|
|
clean: false
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Tools from the runner
|
|
run: bash tools/ci/runner-env.sh
|
|
- name: Vanilla data, and resources prepared by this preparer
|
|
run: bash tools/ci/vanilla-data.sh
|
|
- name: The prepared output is the one the preparer's OUTPUT_VERSION says
|
|
env:
|
|
BASE_SHA: ${{ inputs.base }}
|
|
run: python3 tools/prepare_output.py check --cache --base "$BASE_SHA"
|
|
- name: The version constants are the pinned jar's
|
|
run: python3 tools/gen_version_consts.py --check
|
|
- name: The harnesses this change can affect
|
|
env:
|
|
PARITY_HOSTS: ''
|
|
BASE_SHA: ${{ inputs.base }}
|
|
run: |
|
|
# main's selection (tools/parity.py --changed --list with main's parity.py and parity_reach.py), so a
|
|
# branch made before a better selection landed gets it too; the head's own runner then runs those
|
|
# harnesses. A branch that changes the selection itself selects with its own code.
|
|
set -euo pipefail
|
|
own() { python3 tools/parity.py --changed "$BASE_SHA" --timeout 2400; } # world_spawn takes ~1480 s on a busy runner
|
|
fork_point=$(git merge-base "$BASE_SHA" HEAD)
|
|
if ! git rev-parse --verify -q origin/main >/dev/null || ! git diff --quiet "$fork_point" HEAD -- tools/parity.py tools/parity_reach.py; then
|
|
own
|
|
exit
|
|
fi
|
|
had_reach=$(git ls-files tools/parity_reach.py)
|
|
git show origin/main:tools/parity.py > tools/parity.py
|
|
git show origin/main:tools/parity_reach.py > tools/parity_reach.py
|
|
status=0
|
|
python3 tools/parity.py --changed "$BASE_SHA" --list > .local/parity-selection.txt || status=$?
|
|
git checkout -- tools/parity.py
|
|
if [ -n "$had_reach" ]; then git checkout -- tools/parity_reach.py; else rm -f tools/parity_reach.py; fi
|
|
cat .local/parity-selection.txt
|
|
if [ "$status" != 0 ]; then
|
|
echo "main's selection failed: the head's own selection runs"
|
|
own
|
|
exit
|
|
fi
|
|
names=$(sed '$d' .local/parity-selection.txt | grep -E '^[A-Za-z0-9_#]+$' || true)
|
|
if [ -z "$names" ]; then
|
|
echo "Nothing to run."
|
|
exit 0
|
|
fi
|
|
# shellcheck disable=SC2086
|
|
python3 tools/parity.py $names --timeout 2400
|
|
- name: Logs of the failed harnesses
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: parity-logs
|
|
path: .local/parity-runner/logs/
|
|
if-no-files-found: ignore
|
|
retention-days: 3
|