11name : e2e-mtest
22description : >
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,13 @@ 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
17- default : ' 0.4.0 '
17+ default : ' 0.5.2 '
1818 sha256 :
19- description : sha256 of mtest-<version>-openkal-bundle-all.tar.gz
19+ description : sha256 of mtest-<version>-openkal-bundle-all.tar.gz, for the release taken when xlings cannot install it
2020 required : false
21- default : ' b62e4ac7cd76b20dbdc48a5d041d377444e8815ee7a4ff1e7686145d13acc925 '
21+ default : ' be443f8c546b3f4628dcd3f1eb6f45b4d698a7f805232f966349faf8250863c6 '
2222 token :
2323 description : a token that reads this repository's actions
2424 required : false
@@ -27,24 +27,41 @@ inputs:
2727runs :
2828 using : composite
2929 steps :
30+ # THE ENGINE IS AN XLINGS PACKAGE (xim:mtest), installed as the job installs
31+ # mcpp, verified by the index's sha256, and kept in the job's xlings cache:
32+ # by the configured mirror (GLOBAL), then by CN (GitCode first), each with a
33+ # refreshed index; else the release bundle itself (fetch_release.sh: the
34+ # web address, then the API's), checked against the pinned sha256.
3035 - name : mtest
3136 shell : bash
3237 env :
3338 MTEST_VERSION : ${{ inputs.version }}
3439 MTEST_SHA256 : ${{ inputs.sha256 }}
40+ GITHUB_TOKEN : ${{ inputs.token }}
3541 run : |
3642 set -euo pipefail
37- archive="mtest-$MTEST_VERSION-openkal-bundle-all.tar.gz"
38- temp="$RUNNER_TEMP"; python=python3
39- if [ "$RUNNER_OS" = Windows ]; then temp=$(cygpath -u "$RUNNER_TEMP"); python=python; fi
40- curl -fsSL --retry 5 --retry-all-errors --retry-delay 5 -o "$temp/$archive" \
41- "https://github.com/mcpp-community/mtest/releases/download/v$MTEST_VERSION/$archive"
42- actual=$("$python" -c "import hashlib,sys; print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())" "$temp/$archive")
43- [ "$actual" = "$MTEST_SHA256" ] || { echo "::error::$archive: sha256 $actual, the action pins $MTEST_SHA256"; exit 1; }
44- mkdir -p "$temp/mtest" && tar xzf "$temp/$archive" -C "$temp/mtest"
45- launcher="$temp/mtest/mtest-$MTEST_VERSION-openkal-bundle-all/bin/mtest"
46- [ "$RUNNER_OS" = Windows ] && launcher="$launcher.exe"
47- "$launcher" --version
43+ launcher=""
44+ for mirror in GLOBAL CN; do
45+ xlings config --mirror "$mirror" > /dev/null 2>&1 || true
46+ xlings update > /dev/null 2>&1 || true
47+ if xlings install "mtest@$MTEST_VERSION" -y; then launcher=$(command -v mtest); break; fi
48+ done
49+ xlings config --mirror GLOBAL > /dev/null 2>&1 || true
50+ if [ -z "$launcher" ]; then
51+ echo "::warning::xlings could not install mtest $MTEST_VERSION; taking the release itself"
52+ archive="mtest-$MTEST_VERSION-openkal-bundle-all.tar.gz"
53+ temp="$RUNNER_TEMP"; python=python3
54+ if [ "$RUNNER_OS" = Windows ]; then temp=$(cygpath -u "$RUNNER_TEMP"); python=python; fi
55+ bash "$GITHUB_WORKSPACE/.github/tools/fetch_release.sh" \
56+ "https://github.com/mcpp-community/mtest/releases/download/v$MTEST_VERSION/$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+ fi
63+ "$launcher" --version | grep -qF "$MTEST_VERSION" \
64+ || { echo "::error::the mtest at $launcher is not $MTEST_VERSION: $("$launcher" --version)"; exit 1; }
4865 echo "E2E_MTEST=$launcher" >> "$GITHUB_ENV"
4966 # The pull request's change, for the `pr` set: the base's tip and HEAD's
5067 # parents, so that `git diff <base>...HEAD` has its merge base. When they
0 commit comments