mirror of
https://github.com/lexmount/moli.git
synced 2026-09-28 00:01:34 +00:00
ci: remove migrated workflow legacy
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $# -lt 1 || $# -gt 2 ]]; then
|
||||
echo "usage: $0 head|base [EXPECTED_REVISION]" >&2
|
||||
if [[ $# -ne 2 ]]; then
|
||||
echo "usage: $0 head|base EXPECTED_REVISION" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
side=$1
|
||||
expected_revision=$2
|
||||
case "$side" in
|
||||
head|base) ;;
|
||||
*) echo "invalid release side: $side" >&2; exit 2 ;;
|
||||
@@ -18,10 +19,8 @@ test -f "$archive"
|
||||
mkdir -p target/ci-bin
|
||||
tar -xzf "$archive" -C target/ci-bin
|
||||
(cd "target/ci-bin/$release_name" && sha256sum --check SHA256SUMS)
|
||||
if [[ $# -eq 2 ]]; then
|
||||
actual_revision=$(<"target/ci-bin/$release_name/revision.txt")
|
||||
if [[ "$actual_revision" != "$2" ]]; then
|
||||
echo "$side artifact revision mismatch: expected $2, got $actual_revision" >&2
|
||||
exit 1
|
||||
fi
|
||||
actual_revision=$(<"target/ci-bin/$release_name/revision.txt")
|
||||
if [[ "$actual_revision" != "$expected_revision" ]]; then
|
||||
echo "$side artifact revision mismatch: expected $expected_revision, got $actual_revision" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -36,7 +36,6 @@ jobs:
|
||||
name: Resolve exact revisions
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
target_base_sha: ${{ steps.refs.outputs.target_base_sha }}
|
||||
base_sha: ${{ steps.refs.outputs.base_sha }}
|
||||
head_sha: ${{ steps.refs.outputs.head_sha }}
|
||||
execution_order: ${{ steps.refs.outputs.execution_order }}
|
||||
@@ -72,8 +71,6 @@ jobs:
|
||||
|
||||
target_base_sha=$(git rev-parse "${target_base_ref}^{commit}")
|
||||
base_sha=$(git merge-base "$target_base_sha" "$head_sha")
|
||||
git merge-base --is-ancestor "$base_sha" "$target_base_sha"
|
||||
git merge-base --is-ancestor "$base_sha" "$head_sha"
|
||||
|
||||
if (( GITHUB_RUN_NUMBER % 2 == 0 )); then
|
||||
execution_order=head-first
|
||||
@@ -81,7 +78,6 @@ jobs:
|
||||
execution_order=base-first
|
||||
fi
|
||||
|
||||
echo "target_base_sha=$target_base_sha" >> "$GITHUB_OUTPUT"
|
||||
echo "base_sha=$base_sha" >> "$GITHUB_OUTPUT"
|
||||
echo "head_sha=$head_sha" >> "$GITHUB_OUTPUT"
|
||||
echo "execution_order=$execution_order" >> "$GITHUB_OUTPUT"
|
||||
@@ -246,8 +242,6 @@ jobs:
|
||||
mkdir -p "$package_dir"
|
||||
install -m 0755 target/release/moli "$package_dir/moli"
|
||||
printf '%s\n' '${{ needs.resolve-refs.outputs.head_sha }}' > "$package_dir/revision.txt"
|
||||
"$package_dir/moli" --version > "$package_dir/version.txt"
|
||||
stat --format='%s' "$package_dir/moli" > "$package_dir/size-bytes.txt"
|
||||
(cd "$package_dir" && sha256sum moli > SHA256SUMS)
|
||||
tar -C target/ci-package -czf target/moli-release-head.tar.gz moli-release-head
|
||||
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
@@ -282,8 +276,6 @@ jobs:
|
||||
mkdir -p "$package_dir"
|
||||
install -m 0755 target/release/moli "$package_dir/moli"
|
||||
printf '%s\n' '${{ needs.resolve-refs.outputs.base_sha }}' > "$package_dir/revision.txt"
|
||||
"$package_dir/moli" --version > "$package_dir/version.txt"
|
||||
stat --format='%s' "$package_dir/moli" > "$package_dir/size-bytes.txt"
|
||||
(cd "$package_dir" && sha256sum moli > SHA256SUMS)
|
||||
tar -C target/ci-package -czf target/moli-release-base.tar.gz moli-release-base
|
||||
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
@@ -700,17 +692,6 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ needs.resolve-refs.outputs.head_sha }}
|
||||
- name: Initialize benchmark evidence
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p "$BENCHMARK_OUTPUT"
|
||||
printf '{\n "schema": "moli.browser-spider.run-metadata.v1",\n "status": "resolved",\n "target_base": { "sha": "%s" },\n "base": { "sha": "%s", "role": "common-ancestor" },\n "head": { "sha": "%s" },\n "harness": { "sha": "%s", "role": "exact-head" },\n "execution_order": "%s"\n}\n' \
|
||||
"${{ needs.resolve-refs.outputs.target_base_sha }}" \
|
||||
"${{ needs.resolve-refs.outputs.base_sha }}" \
|
||||
"${{ needs.resolve-refs.outputs.head_sha }}" \
|
||||
"${{ needs.resolve-refs.outputs.head_sha }}" \
|
||||
"${{ needs.resolve-refs.outputs.execution_order }}" \
|
||||
> "$BENCHMARK_OUTPUT/run-metadata.json"
|
||||
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
||||
with:
|
||||
name: moli-release-head
|
||||
@@ -772,17 +753,6 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ needs.resolve-refs.outputs.head_sha }}
|
||||
- name: Initialize soak evidence
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p "$BENCHMARK_OUTPUT"
|
||||
printf '{\n "schema": "moli.sequential-navigation.run-metadata.v1",\n "status": "resolved",\n "target_base": { "sha": "%s" },\n "base": { "sha": "%s", "role": "common-ancestor" },\n "head": { "sha": "%s" },\n "harness": { "sha": "%s", "role": "exact-head" },\n "execution_order": "%s",\n "navigation_count": 200\n}\n' \
|
||||
"${{ needs.resolve-refs.outputs.target_base_sha }}" \
|
||||
"${{ needs.resolve-refs.outputs.base_sha }}" \
|
||||
"${{ needs.resolve-refs.outputs.head_sha }}" \
|
||||
"${{ needs.resolve-refs.outputs.head_sha }}" \
|
||||
"${{ needs.resolve-refs.outputs.execution_order }}" \
|
||||
> "$BENCHMARK_OUTPUT/run-metadata.json"
|
||||
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
||||
with:
|
||||
name: moli-release-head
|
||||
|
||||
@@ -434,31 +434,6 @@ test('infrastructure-comment command writes the trusted fallback comment', () =>
|
||||
}
|
||||
});
|
||||
|
||||
test('CI resolves a common ancestor and reuses exact release artifacts', () => {
|
||||
const benchmarkWorkflow = fs.readFileSync(
|
||||
fileURLToPath(new URL('../../../.github/workflows/ci.yml', import.meta.url)),
|
||||
'utf8'
|
||||
);
|
||||
const commentWorkflow = fs.readFileSync(
|
||||
fileURLToPath(new URL('../../../.github/workflows/spider-bench-comment.yml', import.meta.url)),
|
||||
'utf8'
|
||||
);
|
||||
|
||||
assert.match(
|
||||
benchmarkWorkflow,
|
||||
/base_sha=\$\(git merge-base "\$target_base_sha" "\$head_sha"\)/
|
||||
);
|
||||
assert.match(benchmarkWorkflow, /build-release-head:[\s\S]*name: moli-release-head/);
|
||||
assert.match(benchmarkWorkflow, /build-release-base:[\s\S]*name: moli-release-base/);
|
||||
assert.match(
|
||||
benchmarkWorkflow,
|
||||
/spider-bench:[\s\S]*needs: \[resolve-refs, build-release-head, build-release-base\]/
|
||||
);
|
||||
assert.match(benchmarkWorkflow, /ref: \$\{\{ needs\.resolve-refs\.outputs\.head_sha \}\}/);
|
||||
assert.match(commentWorkflow, /compareCommitsWithBasehead/);
|
||||
assert.match(commentWorkflow, /comparison\.base\?\.sha !== expectedCommonAncestor/);
|
||||
});
|
||||
|
||||
test('Moli endpoint discovery accepts ANSI-formatted tracing output', () => {
|
||||
const log = '\u001b[2m2026-08-03T09:21:36Z\u001b[0m \u001b[32m INFO\u001b[0m '
|
||||
+ 'protocol server listening \u001b[3maddr\u001b[0m\u001b[2m=\u001b[0m127.0.0.1:45445';
|
||||
|
||||
Reference in New Issue
Block a user