Skip to content

Commit 31911e0

Browse files
committed
address review comments
1 parent 7211c6c commit 31911e0

1 file changed

Lines changed: 9 additions & 51 deletions

File tree

.github/workflows/cranelift-release-branch.yml

Lines changed: 9 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@ name: Test upcoming Cranelift release branch
22

33
on:
44
schedule:
5-
# Run daily so we don't miss the release branch cut.
6-
- cron: "0 3 * * *"
5+
- cron: "0 3 6 * *"
76
workflow_dispatch: {}
87

9-
defaults:
10-
run:
11-
shell: bash
12-
138
permissions: {}
149

1510
env:
@@ -42,77 +37,40 @@ jobs:
4237
echo "Latest release branch: ${latest}"
4338
echo "branch=${latest}" >> "$GITHUB_OUTPUT"
4439
45-
- name: Skip if already tested
46-
id: tested_cache
47-
uses: actions/cache@v5
48-
with:
49-
path: .ci/cranelift-release-tested
50-
key: cranelift-release-tested-${{ steps.wasmtime_release_branch.outputs.branch }}
51-
52-
- name: Mark tested (cache payload)
53-
if: steps.tested_cache.outputs.cache-hit != 'true'
54-
run: |
55-
mkdir -p .ci/cranelift-release-tested
56-
echo "${{ steps.wasmtime_release_branch.outputs.branch }}" > .ci/cranelift-release-tested/branch.txt
57-
5840
- name: Patch Cargo.toml to use release branch Cranelift
59-
if: steps.tested_cache.outputs.cache-hit != 'true'
6041
run: |
6142
set -euo pipefail
62-
branch="${{ steps.wasmtime_release_branch.outputs.branch }}"
63-
6443
python3 - <<'PY'
65-
import pathlib, re, os
44+
import pathlib
45+
import os
46+
6647
cargo_toml = pathlib.Path("Cargo.toml")
6748
s = cargo_toml.read_text(encoding="utf-8")
6849
6950
branch = os.environ["WASMTIME_RELEASE_BRANCH"]
70-
patch_lines = "\n".join([
51+
patch_block = "\n".join([
52+
"",
53+
"[patch.crates-io]",
7154
f'cranelift-codegen = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}',
7255
f'cranelift-frontend = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}',
7356
f'cranelift-module = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}',
7457
f'cranelift-native = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}',
7558
f'cranelift-jit = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}',
7659
f'cranelift-object = {{ git = "https://github.com/bytecodealliance/wasmtime.git", branch = "{branch}" }}',
60+
"",
7761
])
78-
79-
# Ensure a [patch.crates-io] section exists.
80-
if "[patch.crates-io]" not in s:
81-
s += "\n\n[patch.crates-io]\n"
82-
83-
# Remove any previous CI-inserted patch block.
84-
s = re.sub(
85-
r"(?ms)^\n?# BEGIN CI WASMTIME RELEASE PATCH\n.*?^\# END CI WASMTIME RELEASE PATCH\n",
86-
"\n",
87-
s,
88-
)
89-
90-
# Insert immediately after the [patch.crates-io] header.
91-
s = re.sub(
92-
r"(?m)^\[patch\.crates-io\]\s*$",
93-
"[patch.crates-io]\n"
94-
"# BEGIN CI WASMTIME RELEASE PATCH\n"
95-
f"{patch_lines}\n"
96-
"# END CI WASMTIME RELEASE PATCH",
97-
s,
98-
count=1,
99-
)
100-
101-
cargo_toml.write_text(s, encoding="utf-8")
62+
cargo_toml.write_text(s.rstrip() + patch_block, encoding="utf-8")
10263
PY
10364
env:
10465
WASMTIME_RELEASE_BRANCH: ${{ steps.wasmtime_release_branch.outputs.branch }}
10566

10667
- name: Prepare dependencies
107-
if: steps.tested_cache.outputs.cache-hit != 'true'
10868
run: ./y.sh prepare
10969

11070
- name: Build (sysroot none)
111-
if: steps.tested_cache.outputs.cache-hit != 'true'
11271
run: ./y.sh build --sysroot none
11372

11473
- name: Test
115-
if: steps.tested_cache.outputs.cache-hit != 'true'
11674
env:
11775
TARGET_TRIPLE: x86_64-unknown-linux-gnu
11876
run: ./y.sh test

0 commit comments

Comments
 (0)