Skip to content

Commit 3e1a1e3

Browse files
committed
CI: separate build workflows per OS for individual badges
- Create reusable build workflow to consolidate build logic - Rename ci.yaml to tests.yaml focusing on test execution - Add individual workflow files for each supported platform: - Ubuntu 22.04, 24.04, and 24.04 ARM - macOS 13, 14, 15, and latest - Update README badges to use new workflow-specific URLs - Optimize test dependencies to use only ubuntu-22.04 builds - Clean up job names by removing redundant "-for-tests" suffixes This enables individual GitHub Actions badges per OS platform while maintaining code reuse through the reusable workflow pattern.
1 parent 56ecdb1 commit 3e1a1e3

File tree

10 files changed

+316
-174
lines changed

10 files changed

+316
-174
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build macOS 13
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
paths-ignore: ["frontend"]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/build-reusable.yaml
17+
with:
18+
os: macos-13
19+
cache-prefix: macos-13-
20+
build-wasm: true
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build macOS 14
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
paths-ignore: ["frontend"]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/build-reusable.yaml
17+
with:
18+
os: macos-14
19+
cache-prefix: macos-14-
20+
build-wasm: true
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build macOS 15
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
paths-ignore: ["frontend"]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/build-reusable.yaml
17+
with:
18+
os: macos-15
19+
cache-prefix: macos-15-
20+
build-wasm: true
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build macOS Latest
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
paths-ignore: ["frontend"]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/build-reusable.yaml
17+
with:
18+
os: macos-latest
19+
cache-prefix: macos-latest-
20+
build-wasm: true
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Reusable Build Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
description: "Operating system to build on"
10+
ocaml_version:
11+
required: false
12+
type: string
13+
default: "4.14.2"
14+
description: "OCaml version to use"
15+
cache-prefix:
16+
required: false
17+
type: string
18+
default: ""
19+
description: "Cache prefix for the build"
20+
build-wasm:
21+
required: false
22+
type: boolean
23+
default: false
24+
description: "Whether to build WASM targets"
25+
26+
env:
27+
CARGO_TERM_COLOR: always
28+
RUST_BACKTRACE: full
29+
MINA_PANIC_ON_BUG: true
30+
CARGO_INCREMENTAL: 1
31+
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off -C link-args=-Wl,-undefined,dynamic_lookup"
32+
33+
jobs:
34+
build:
35+
timeout-minutes: 60
36+
runs-on: ${{ inputs.os }}
37+
steps:
38+
- name: Git checkout
39+
uses: actions/checkout@v5
40+
41+
- name: Setup build dependencies
42+
uses: ./.github/actions/setup-build-deps
43+
44+
- name: Use shared OCaml setting up steps
45+
uses: ./.github/actions/setup-ocaml
46+
with:
47+
ocaml_version: ${{ inputs.ocaml_version }}
48+
49+
- name: Setup Rust
50+
uses: ./.github/actions/setup-rust
51+
with:
52+
toolchain: 1.84
53+
cache-prefix: build-${{ inputs.os }}-${{ inputs.cache-prefix }}v0
54+
55+
- name: Release build
56+
run: make build-release
57+
58+
- name: Verify build-info command
59+
run: |
60+
echo "Testing build-info command..."
61+
./target/release/mina build-info
62+
63+
# Verify required fields are present
64+
./target/release/mina build-info | grep -E "Version:|Build time:|Commit SHA:|Commit branch:|Rustc version:"
65+
66+
# Verify version format (should be a short commit hash)
67+
VERSION=$(./target/release/mina build-info | grep "Version:" | awk '{print $2}')
68+
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]]; then
69+
echo "Error: Version should be a 7-character commit hash, got: $VERSION"
70+
exit 1
71+
fi
72+
73+
echo "Build info verification passed!"
74+
75+
build-tests:
76+
timeout-minutes: 60
77+
runs-on: ${{ inputs.os }}
78+
steps:
79+
- name: Git checkout
80+
uses: actions/checkout@v5
81+
82+
- name: Setup build dependencies
83+
uses: ./.github/actions/setup-build-deps
84+
85+
- name: Use shared OCaml setting up steps
86+
uses: ./.github/actions/setup-ocaml
87+
with:
88+
ocaml_version: ${{ inputs.ocaml_version }}
89+
90+
- name: Setup Rust
91+
uses: ./.github/actions/setup-rust
92+
with:
93+
toolchain: 1.84
94+
cache-prefix: build-tests-${{ inputs.os }}-${{ inputs.cache-prefix }}v0
95+
96+
- name: Build tests
97+
run: make build-tests
98+
99+
build-tests-webrtc:
100+
timeout-minutes: 60
101+
runs-on: ${{ inputs.os }}
102+
steps:
103+
- name: Git checkout
104+
uses: actions/checkout@v5
105+
106+
- name: Setup build dependencies
107+
uses: ./.github/actions/setup-build-deps
108+
109+
- name: Use shared OCaml setting up steps
110+
uses: ./.github/actions/setup-ocaml
111+
with:
112+
ocaml_version: ${{ inputs.ocaml_version }}
113+
114+
- name: Setup Rust
115+
uses: ./.github/actions/setup-rust
116+
with:
117+
toolchain: 1.84
118+
cache-prefix: build-tests-webrtc-${{ inputs.os }}-${{ inputs.cache-prefix }}v0
119+
120+
- name: Build tests
121+
run: make build-tests-webrtc
122+
123+
build-wasm:
124+
if: ${{ inputs.build-wasm }}
125+
timeout-minutes: 60
126+
runs-on: ${{ inputs.os }}
127+
steps:
128+
- name: Git checkout
129+
uses: actions/checkout@v5
130+
131+
- name: Setup build dependencies
132+
uses: ./.github/actions/setup-build-deps
133+
134+
- name: Use shared OCaml setting up steps
135+
uses: ./.github/actions/setup-ocaml
136+
with:
137+
ocaml_version: ${{ inputs.ocaml_version }}
138+
139+
- name: Setup WebAssembly environment
140+
uses: ./.github/actions/setup-wasm
141+
with:
142+
cache-prefix: wasm-${{ inputs.os }}-${{ inputs.cache-prefix }}v0
143+
144+
- name: Release build
145+
run: make build-wasm
146+
env:
147+
RUSTFLAGS: ""
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build Ubuntu 22.04
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
paths-ignore: ["frontend"]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/build-reusable.yaml
17+
with:
18+
os: ubuntu-22.04
19+
cache-prefix: ubuntu-22-04-
20+
build-wasm: true
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build Ubuntu 24.04 ARM
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
paths-ignore: ["frontend"]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/build-reusable.yaml
17+
with:
18+
os: ubuntu-24.04-arm
19+
cache-prefix: ubuntu-24-04-arm-
20+
build-wasm: true
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build Ubuntu 24.04
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
paths-ignore: ["frontend"]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/build-reusable.yaml
17+
with:
18+
os: ubuntu-24.04
19+
cache-prefix: ubuntu-24-04-
20+
build-wasm: true

0 commit comments

Comments
 (0)