Skip to content

Commit 6e73227

Browse files
ci: the e2e mtest engine is the xlings package xim:mtest, installed with an index refresh per attempt
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent c82c95c commit 6e73227

1 file changed

Lines changed: 15 additions & 33 deletions

File tree

‎.github/actions/e2e-mtest/action.yml‎

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: e2e-mtest
22
description: >
33
mtest for the e2e suite (design 2026-11-08 W8; tests/e2e/mtest.toml): the
4-
release this action pins, its sha256 checked, and the stores main's last
4+
release this action pins, installed by xlings, and the stores main's last
55
successful CI run kept for this host, taken into tests/e2e/.mtest so that
66
`--shard` divides the suite by measured time and a run orders its tests
77
longest first. Exports E2E_MTEST for run_all.sh. A run with no store of main
@@ -12,13 +12,9 @@ inputs:
1212
description: the host's name in the stores' artifact names (linux, macos, windows)
1313
required: true
1414
version:
15-
description: the mtest release
15+
description: the mtest release, an xlings package (xim:mtest), whose sha256 the index states
1616
required: false
1717
default: '0.5.2'
18-
sha256:
19-
description: sha256 of mtest-<version>-openkal-bundle-all.tar.gz
20-
required: false
21-
default: 'be443f8c546b3f4628dcd3f1eb6f45b4d698a7f805232f966349faf8250863c6'
2218
token:
2319
description: a token that reads this repository's actions
2420
required: false
@@ -27,39 +23,25 @@ inputs:
2723
runs:
2824
using: composite
2925
steps:
30-
# The bundle is a release's fixed bytes: kept once per version, so that a
31-
# job downloads it only when no job before it did.
32-
- name: The mtest bundle, kept
33-
id: bundle
34-
uses: actions/cache@v4
35-
with:
36-
path: ${{ runner.temp }}/mtest-bundle
37-
key: mtest-bundle-${{ inputs.version }}-${{ inputs.sha256 }}
26+
# THE ENGINE IS AN XLINGS PACKAGE (xim:mtest): installed as the job installs
27+
# mcpp and its toolchains, verified by the index's sha256, from the mirror
28+
# xlings is configured for, and kept in the job's xlings cache.
3829
- name: mtest
3930
shell: bash
4031
env:
4132
MTEST_VERSION: ${{ inputs.version }}
42-
MTEST_SHA256: ${{ inputs.sha256 }}
43-
GITHUB_TOKEN: ${{ inputs.token }}
4433
run: |
4534
set -euo pipefail
46-
archive="mtest-$MTEST_VERSION-openkal-bundle-all.tar.gz"
47-
temp="$RUNNER_TEMP"; python=python3
48-
if [ "$RUNNER_OS" = Windows ]; then temp=$(cygpath -u "$RUNNER_TEMP"); python=python; fi
49-
mkdir -p "$temp/mtest-bundle"
50-
if [ ! -s "$temp/mtest-bundle/$archive" ]; then
51-
# Retried, and by the API's address when the web's fails (fetch_release.sh).
52-
bash "$GITHUB_WORKSPACE/.github/tools/fetch_release.sh" \
53-
"https://github.com/mcpp-community/mtest/releases/download/v$MTEST_VERSION/$archive" \
54-
"$temp/mtest-bundle/$archive"
55-
fi
56-
cp "$temp/mtest-bundle/$archive" "$temp/$archive"
57-
actual=$("$python" -c "import hashlib,sys; print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())" "$temp/$archive")
58-
[ "$actual" = "$MTEST_SHA256" ] || { echo "::error::$archive: sha256 $actual, the action pins $MTEST_SHA256"; exit 1; }
59-
mkdir -p "$temp/mtest" && tar xzf "$temp/$archive" -C "$temp/mtest"
60-
launcher="$temp/mtest/mtest-$MTEST_VERSION-openkal-bundle-all/bin/mtest"
61-
[ "$RUNNER_OS" = Windows ] && launcher="$launcher.exe"
62-
"$launcher" --version
35+
# An attempt refreshes the index first: a job's cached index can predate the release.
36+
for attempt in 1 2 3 4 5; do
37+
xlings update > /dev/null 2>&1 || true
38+
if xlings install "mtest@$MTEST_VERSION" -y; then break; fi
39+
[ "$attempt" = 5 ] && { echo "::error::mtest@$MTEST_VERSION could not be installed"; exit 1; }
40+
sleep 30
41+
done
42+
launcher=$(command -v mtest)
43+
"$launcher" --version | grep -qF "$MTEST_VERSION" \
44+
|| { echo "::error::xlings's mtest is not $MTEST_VERSION: $("$launcher" --version)"; exit 1; }
6345
echo "E2E_MTEST=$launcher" >> "$GITHUB_ENV"
6446
# The pull request's change, for the `pr` set: the base's tip and HEAD's
6547
# parents, so that `git diff <base>...HEAD` has its merge base. When they

0 commit comments

Comments
 (0)