Skip to content

Commit 7357f59

Browse files
committed
Regressions on several workflows that removed the setup/build/test job split. The release workflow was not correct and not triggering.
1 parent 0579584 commit 7357f59

8 files changed

Lines changed: 241 additions & 29 deletions

.github/workflows/aarch64-apple-darwin.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,43 @@ name: aarch64-apple-darwin
33
on: [push, pull_request]
44

55
jobs:
6-
build-and-test:
6+
setup-aarch64-apple-darwin:
77
runs-on: macos-15
88
steps:
99
- uses: actions/checkout@v4
1010
- name: Install dependencies
1111
run: brew install cmake
12-
- name: Build and Test
12+
13+
build-aarch64-apple-darwin:
14+
runs-on: macos-15
15+
needs: setup-aarch64-apple-darwin
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Install dependencies
19+
run: brew install cmake
20+
- name: Configure
1321
run: |
1422
mkdir -p build && cd build
1523
cmake -G "Unix Makefiles" -DTARGET=aarch64-apple-darwin ..
16-
make -j$(sysctl -n hw.ncpu)
17-
ctest --output-on-failure
24+
- name: Build
25+
run: cd build && make -j$(sysctl -n hw.ncpu)
26+
- name: Upload build artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: build-aarch64-apple-darwin
30+
path: build/
31+
32+
test-aarch64-apple-darwin:
33+
runs-on: macos-15
34+
needs: build-aarch64-apple-darwin
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Download build artifacts
38+
uses: actions/download-artifact@v4
39+
with:
40+
name: build-aarch64-apple-darwin
41+
path: build/
42+
- name: Restore execute permissions
43+
run: chmod +x build/bin/*
44+
- name: Run Tests
45+
run: cd build && ctest --output-on-failure

.github/workflows/aarch64-pc-linux-gnu.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,47 @@ name: aarch64-pc-linux-gnu
33
on: [push, pull_request]
44

55
jobs:
6-
build-and-test:
6+
setup-aarch64-pc-linux-gnu:
77
runs-on: ubuntu-24.04-arm
88
steps:
99
- uses: actions/checkout@v4
1010
- name: Install dependencies
1111
run: |
1212
sudo apt-get update
1313
sudo apt-get install -y cmake build-essential
14-
- name: Build and Test
14+
15+
build-aarch64-pc-linux-gnu:
16+
runs-on: ubuntu-24.04-arm
17+
needs: setup-aarch64-pc-linux-gnu
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Install dependencies
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y cmake build-essential
24+
- name: Configure
1525
run: |
1626
mkdir -p build && cd build
1727
cmake -G "Unix Makefiles" -DTARGET=aarch64-pc-linux-gnu ..
18-
make -j$(nproc)
19-
ctest --output-on-failure
28+
- name: Build
29+
run: cd build && make -j$(nproc)
30+
- name: Upload build artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: build-aarch64-pc-linux-gnu
34+
path: build/
35+
36+
test-aarch64-pc-linux-gnu:
37+
runs-on: ubuntu-24.04-arm
38+
needs: build-aarch64-pc-linux-gnu
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Download build artifacts
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: build-aarch64-pc-linux-gnu
45+
path: build/
46+
- name: Restore execute permissions
47+
run: chmod +x build/bin/*
48+
- name: Run Tests
49+
run: cd build && ctest --output-on-failure

.github/workflows/aarch64-pc-windows-gnu.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,21 @@ name: aarch64-pc-windows-gnu
33
on: [push, pull_request]
44

55
jobs:
6+
setup-aarch64-pc-windows-gnu:
7+
runs-on: windows-11-arm
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Setup MinGW
11+
uses: msys2/setup-msys2@v2
12+
with:
13+
msystem: CLANGARM64
14+
update: true
15+
cache: true
16+
install: mingw-w64-clang-aarch64-toolchain mingw-w64-clang-aarch64-cmake
17+
618
build-aarch64-pc-windows-gnu:
719
runs-on: windows-11-arm
20+
needs: setup-aarch64-pc-windows-gnu
821
steps:
922
- uses: actions/checkout@v4
1023
- name: Setup MinGW

.github/workflows/release.yml

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ on:
3131
- riscv64-musl-linux
3232
types:
3333
- completed
34-
branches:
35-
- release
3634

3735
permissions:
3836
contents: write
@@ -41,10 +39,34 @@ permissions:
4139
jobs:
4240
check-and-release:
4341
runs-on: ubuntu-latest
44-
# Only run if the triggering workflow succeeded AND it ran on the release branch
45-
if: ${{ github.event.workflow_run.head_branch == 'release' && github.event.workflow_run.conclusion == 'success' }}
4642
steps:
43+
- name: Log trigger information
44+
run: |
45+
echo "Triggered by workflow: ${{ github.event.workflow_run.name }}"
46+
echo "Workflow status: ${{ github.event.workflow_run.conclusion }}"
47+
echo "Branch: ${{ github.event.workflow_run.head_branch }}"
48+
echo "Commit SHA: ${{ github.event.workflow_run.head_sha }}"
49+
50+
- name: Validate release branch and workflow success
51+
id: validate
52+
run: |
53+
if [ "${{ github.event.workflow_run.head_branch }}" != "release" ]; then
54+
echo "Skipping: Not on release branch (on ${{ github.event.workflow_run.head_branch }})"
55+
echo "proceed=false" >> $GITHUB_OUTPUT
56+
exit 0
57+
fi
58+
59+
if [ "${{ github.event.workflow_run.conclusion }}" != "success" ]; then
60+
echo "Skipping: Workflow did not succeed (conclusion: ${{ github.event.workflow_run.conclusion }})"
61+
echo "proceed=false" >> $GITHUB_OUTPUT
62+
exit 0
63+
fi
64+
65+
echo "Validation passed: On release branch with successful workflow"
66+
echo "proceed=true" >> $GITHUB_OUTPUT
67+
4768
- name: Check all workflow statuses
69+
if: steps.validate.outputs.proceed == 'true'
4870
id: check-all
4971
uses: actions/github-script@v7
5072
with:
@@ -104,42 +126,64 @@ jobs:
104126
105127
const failed = [];
106128
const pending = [];
129+
const succeeded = [];
107130
108131
for (const name of target_workflows) {
109132
const run = latest_runs[name];
110-
if (!run || run.status !== 'completed') {
133+
if (!run) {
134+
console.log(` ${name}: NO RUN FOUND`);
135+
pending.push(name);
136+
} else if (run.status !== 'completed') {
137+
console.log(` ${name}: ${run.status}`);
111138
pending.push(name);
112139
} else if (run.conclusion !== 'success') {
140+
console.log(` ${name}: completed with ${run.conclusion}`);
113141
failed.push(name);
142+
} else {
143+
console.log(` ${name}: success`);
144+
succeeded.push(name);
114145
}
115146
}
116147
148+
console.log(`\nSummary: ${succeeded.length} succeeded, ${pending.length} pending, ${failed.length} failed`);
149+
117150
if (pending.length > 0) {
118-
console.log(`Waiting for other workflows to complete: ${pending.join(', ')}`);
151+
console.log(`Waiting for ${pending.length} workflows to complete: ${pending.join(', ')}`);
152+
core.setOutput("ready", "false");
153+
core.notice(`Release skipped: waiting for ${pending.length} workflows to complete`);
119154
return; // Exit successfully but do nothing; wait for next trigger
120155
}
121156
122157
if (failed.length > 0) {
123158
core.setFailed(`One or more workflows failed: ${failed.join(', ')}`);
159+
core.setOutput("ready", "false");
124160
return;
125161
}
126162
127163
console.log("All target workflows passed successfully!");
164+
core.notice("All required workflows passed - creating release");
128165
core.setOutput("ready", "true");
129166
130167
- name: Perform Release
131-
if: steps.check-all.outputs.ready == 'true'
168+
if: steps.validate.outputs.proceed == 'true' && steps.check-all.outputs.ready == 'true'
132169
uses: actions/checkout@v4
133170
with:
134171
ref: ${{ github.event.workflow_run.head_sha }}
135172
fetch-depth: 0
136173

137174
- name: Get Version
138-
if: steps.check-all.outputs.ready == 'true'
139-
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
175+
if: steps.validate.outputs.proceed == 'true' && steps.check-all.outputs.ready == 'true'
176+
run: |
177+
if [ ! -f VERSION ]; then
178+
echo "ERROR: VERSION file not found"
179+
exit 1
180+
fi
181+
VERSION=$(cat VERSION)
182+
echo "Creating release for version: $VERSION"
183+
echo "VERSION=$VERSION" >> $GITHUB_ENV
140184
141185
- name: Get Release Details
142-
if: steps.check-all.outputs.ready == 'true'
186+
if: steps.validate.outputs.proceed == 'true' && steps.check-all.outputs.ready == 'true'
143187
id: release_details
144188
uses: actions/github-script@v7
145189
with:
@@ -178,7 +222,7 @@ jobs:
178222
core.setOutput("body", body);
179223
180224
- name: Create Release
181-
if: steps.check-all.outputs.ready == 'true'
225+
if: steps.validate.outputs.proceed == 'true' && steps.check-all.outputs.ready == 'true'
182226
uses: softprops/action-gh-release@v1
183227
with:
184228
tag_name: v${{ env.VERSION }}

.github/workflows/x86_64-apple-darwin.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,43 @@ name: x86_64-apple-darwin
33
on: [push, pull_request]
44

55
jobs:
6-
build-and-test:
6+
setup-x86_64-apple-darwin:
77
runs-on: macos-15-intel
88
steps:
99
- uses: actions/checkout@v4
1010
- name: Install dependencies
1111
run: brew install cmake
12-
- name: Build and Test
12+
13+
build-x86_64-apple-darwin:
14+
runs-on: macos-15-intel
15+
needs: setup-x86_64-apple-darwin
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Install dependencies
19+
run: brew install cmake
20+
- name: Configure
1321
run: |
1422
mkdir -p build && cd build
1523
cmake -G "Unix Makefiles" -DTARGET=x86_64-apple-darwin ..
16-
make -j$(sysctl -n hw.ncpu)
17-
ctest --output-on-failure
24+
- name: Build
25+
run: cd build && make -j$(sysctl -n hw.ncpu)
26+
- name: Upload build artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: build-x86_64-apple-darwin
30+
path: build/
31+
32+
test-x86_64-apple-darwin:
33+
runs-on: macos-15-intel
34+
needs: build-x86_64-apple-darwin
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Download build artifacts
38+
uses: actions/download-artifact@v4
39+
with:
40+
name: build-x86_64-apple-darwin
41+
path: build/
42+
- name: Restore execute permissions
43+
run: chmod +x build/bin/*
44+
- name: Run Tests
45+
run: cd build && ctest --output-on-failure

.github/workflows/x86_64-pc-linux-gnu.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,50 @@ name: x86_64-pc-linux-gnu
33
on: [push, pull_request]
44

55
jobs:
6-
build-and-test:
6+
setup-x86_64-pc-linux-gnu:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v4
1010
- name: Install dependencies
1111
run: |
1212
sudo apt-get update
1313
sudo apt-get install -y cmake build-essential
14-
- name: Build and Test
14+
15+
build-x86_64-pc-linux-gnu:
16+
runs-on: ubuntu-latest
17+
needs: setup-x86_64-pc-linux-gnu
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Install dependencies
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y cmake build-essential
24+
- name: Configure
1525
run: |
1626
mkdir -p build && cd build
1727
cmake -G "Unix Makefiles" -DTARGET=x86_64-pc-linux-gnu -DENABLE_COVERAGE=ON ..
18-
make -j$(nproc)
19-
ctest --output-on-failure
28+
- name: Build
29+
run: cd build && make -j$(nproc)
30+
- name: Upload build artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: build-x86_64-pc-linux-gnu
34+
path: build/
35+
36+
test-x86_64-pc-linux-gnu:
37+
runs-on: ubuntu-latest
38+
needs: build-x86_64-pc-linux-gnu
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Download build artifacts
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: build-x86_64-pc-linux-gnu
45+
path: build/
46+
- name: Restore execute permissions
47+
run: chmod +x build/bin/*
48+
- name: Run Tests
49+
run: cd build && ctest --output-on-failure
2050
- name: Upload coverage to Codecov
2151
uses: codecov/codecov-action@v4
2252
with:

.github/workflows/x86_64-pc-windows-gnu.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,21 @@ name: x86_64-pc-windows-gnu
33
on: [push, pull_request]
44

55
jobs:
6+
setup-x86_64-pc-windows-gnu:
7+
runs-on: windows-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Setup MinGW
11+
uses: msys2/setup-msys2@v2
12+
with:
13+
msystem: MINGW64
14+
update: true
15+
cache: true
16+
install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake
17+
618
build-x86_64-pc-windows-gnu:
719
runs-on: windows-latest
20+
needs: setup-x86_64-pc-windows-gnu
821
steps:
922
- uses: actions/checkout@v4
1023
- name: Setup MinGW

0 commit comments

Comments
 (0)