-
Notifications
You must be signed in to change notification settings - Fork 40
Consolidate build workflows #1562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
name: Reusable Build Workflow | ||
name: Build CI | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
branches: [main, develop] | ||
workflow_dispatch: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
description: "Operating system to build on" | ||
ocaml_version: | ||
required: false | ||
type: string | ||
default: "4.14.2" | ||
description: "OCaml version to use" | ||
cache-prefix: | ||
description: 'OS to build on. If empty, builds on all supported OSes.' | ||
required: false | ||
default: '' | ||
type: string | ||
default: "" | ||
description: "Cache prefix for the build" | ||
build-wasm: | ||
required: false | ||
type: boolean | ||
default: false | ||
description: "Whether to build WASM targets" | ||
rustflags: | ||
required: false | ||
type: string | ||
default: "" | ||
description: "Additional RUSTFLAGS to append (e.g., macOS-specific linker flags)" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
@@ -37,10 +24,12 @@ env: | |
|
||
jobs: | ||
build: | ||
timeout-minutes: 60 | ||
runs-on: ${{ inputs.os }} | ||
strategy: | ||
matrix: | ||
os: ${{ github.event.inputs.os && fromJSON(format('["{0}"]', github.event.inputs.os)) || fromJSON('["ubuntu-22.04", "ubuntu-24.04", "ubuntu-24.04-arm", "macos-13", "macos-14", "macos-15", "macos-latest"]') }} | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ inputs.rustflags }}" | ||
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ startsWith(matrix.os, 'macos') && '-C link-args=-Wl,-undefined,dynamic_lookup' || '' }}" | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v5 | ||
|
@@ -51,13 +40,13 @@ jobs: | |
- name: Use shared OCaml setting up steps | ||
uses: ./.github/actions/setup-ocaml | ||
with: | ||
ocaml_version: ${{ inputs.ocaml_version }} | ||
ocaml_version: '4.14.2' | ||
|
||
- name: Setup Rust | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
toolchain: 1.84 | ||
cache-prefix: build-${{ inputs.os }}-${{ inputs.cache-prefix }}v0 | ||
cache-prefix: build-${{ matrix.os }}-${{ matrix.os }}-v0 | ||
|
||
- name: Release build | ||
run: make build-release | ||
|
@@ -80,10 +69,12 @@ jobs: | |
echo "Build info verification passed!" | ||
|
||
build-tests: | ||
timeout-minutes: 60 | ||
runs-on: ${{ inputs.os }} | ||
strategy: | ||
matrix: | ||
os: ${{ github.event.inputs.os && fromJSON(format('["{0}"]', github.event.inputs.os)) || fromJSON('["ubuntu-22.04", "ubuntu-24.04", "ubuntu-24.04-arm", "macos-13", "macos-14", "macos-15", "macos-latest"]') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line has been repeated several time. I'll see if there's a better way that we can do this |
||
runs-on: ${{ matrix.os }} | ||
env: | ||
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ inputs.rustflags }}" | ||
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ startsWith(matrix.os, 'macos') && '-C link-args=-Wl,-undefined,dynamic_lookup' || '' }}" | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v5 | ||
|
@@ -94,22 +85,24 @@ jobs: | |
- name: Use shared OCaml setting up steps | ||
uses: ./.github/actions/setup-ocaml | ||
with: | ||
ocaml_version: ${{ inputs.ocaml_version }} | ||
ocaml_version: '4.14.2' | ||
|
||
- name: Setup Rust | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
toolchain: 1.84 | ||
cache-prefix: build-tests-${{ inputs.os }}-${{ inputs.cache-prefix }}v0 | ||
cache-prefix: build-tests-${{ matrix.os }}-${{ matrix.os }}-v0 | ||
|
||
- name: Build tests | ||
run: make build-tests | ||
|
||
build-tests-webrtc: | ||
timeout-minutes: 60 | ||
runs-on: ${{ inputs.os }} | ||
strategy: | ||
matrix: | ||
os: ${{ github.event.inputs.os && fromJSON(format('["{0}"]', github.event.inputs.os)) || fromJSON('["ubuntu-22.04", "ubuntu-24.04", "ubuntu-24.04-arm", "macos-13", "macos-14", "macos-15", "macos-latest"]') }} | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ inputs.rustflags }}" | ||
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ startsWith(matrix.os, 'macos') && '-C link-args=-Wl,-undefined,dynamic_lookup' || '' }}" | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v5 | ||
|
@@ -120,23 +113,25 @@ jobs: | |
- name: Use shared OCaml setting up steps | ||
uses: ./.github/actions/setup-ocaml | ||
with: | ||
ocaml_version: ${{ inputs.ocaml_version }} | ||
ocaml_version: '4.14.2' | ||
|
||
- name: Setup Rust | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
toolchain: 1.84 | ||
cache-prefix: build-tests-webrtc-${{ inputs.os }}-${{ inputs.cache-prefix }}v0 | ||
cache-prefix: build-tests-webrtc-${{ matrix.os }}-${{ matrix.os }}-v0 | ||
|
||
- name: Build tests | ||
run: make build-tests-webrtc | ||
|
||
build-benches: | ||
needs: [build] | ||
timeout-minutes: 60 | ||
runs-on: ${{ inputs.os }} | ||
strategy: | ||
matrix: | ||
os: ${{ github.event.inputs.os && fromJSON(format('["{0}"]', github.event.inputs.os)) || fromJSON('["ubuntu-22.04", "ubuntu-24.04", "ubuntu-24.04-arm", "macos-13", "macos-14", "macos-15", "macos-latest"]') }} | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ inputs.rustflags }}" | ||
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off ${{ startsWith(matrix.os, 'macos') && '-C link-args=-Wl,-undefined,dynamic_lookup' || '' }}" | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v5 | ||
|
@@ -147,21 +142,22 @@ jobs: | |
- name: Use shared OCaml setting up steps | ||
uses: ./.github/actions/setup-ocaml | ||
with: | ||
ocaml_version: ${{ inputs.ocaml_version }} | ||
ocaml_version: '4.14.2' | ||
|
||
- name: Setup Rust | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
toolchain: 1.84 | ||
cache-prefix: build-${{ inputs.os }}-${{ inputs.cache-prefix }}v0 | ||
cache-prefix: build-${{ matrix.os }}-${{ matrix.os }}-v0 | ||
|
||
- name: Build benchmarks | ||
run: make build-benches | ||
|
||
build-wasm: | ||
if: ${{ inputs.build-wasm }} | ||
timeout-minutes: 60 | ||
runs-on: ${{ inputs.os }} | ||
strategy: | ||
matrix: | ||
os: ${{ github.event.inputs.os && fromJSON(format('["{0}"]', github.event.inputs.os)) || fromJSON('["ubuntu-22.04", "ubuntu-24.04", "ubuntu-24.04-arm", "macos-13", "macos-14", "macos-15", "macos-latest"]') }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v5 | ||
|
@@ -172,14 +168,14 @@ jobs: | |
- name: Use shared OCaml setting up steps | ||
uses: ./.github/actions/setup-ocaml | ||
with: | ||
ocaml_version: ${{ inputs.ocaml_version }} | ||
ocaml_version: '4.14.2' | ||
|
||
- name: Setup WebAssembly environment | ||
uses: ./.github/actions/setup-wasm | ||
with: | ||
cache-prefix: wasm-${{ inputs.os }}-${{ inputs.cache-prefix }}v0 | ||
cache-prefix: wasm-${{ matrix.os }}-${{ matrix.os }}-v0 | ||
|
||
- name: Release build | ||
run: make build-wasm | ||
env: | ||
RUSTFLAGS: "" | ||
RUSTFLAGS: "" |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Frontend CI Test | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
os: | ||
description: 'OS to build on.' | ||
required: false | ||
default: 'ubuntu-24.04' | ||
type: string | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ github.event.inputs.os }} | ||
steps: | ||
- name: Echo | ||
run: echo "Hello, world!" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Frontend CI | ||
|
||
on: | ||
push: | ||
branches: [main, develop] | ||
pull_request: | ||
workflow_dispatch: | ||
inputs: | ||
os: | ||
description: 'OS to build on. If empty, builds on all supported OSes.' | ||
required: false | ||
default: '' | ||
type: string | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: ${{ github.event.inputs.os && fromJSON(format('["{0}"]', github.event.inputs.os)) || fromJSON('["ubuntu-22.04", "ubuntu-24.04-arm", "macos-13", "macos-14", "macos-15", "macos-latest"]') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above |
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v5 | ||
|
||
- name: Frontend build | ||
uses: ./.github/actions/frontend-build | ||
with: | ||
test-build-commands: 'true' | ||
|
||
lint-and-test: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v5 | ||
|
||
- name: Frontend build and test | ||
uses: ./.github/actions/frontend-build | ||
with: | ||
run-prettier-check: 'true' | ||
run-tests: 'true' | ||
test-build-commands: 'false' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of having separated files is to have different badges to add in the README: https://github.com/o1-labs/mina-rust?tab=readme-ov-file#supported-platforms. We can therefore see which platform is supported and the ones that are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that really doesn't make sense that checks in a PR work on a job-by-job basis but status badges only work on a workflow by workflow basis. Let me see if there's another way to do this. It's a lot harder to get a complete picture of what's going on when only looking at the code if you have a bunch of different workflows all with the exact same trigger
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we can just use shields.io, it's free

https://img.shields.io/github/check-runs/o1-labs/mina-rust/rp/test-everything?nameFilter=deploy
I haven't quite figured out the naming (
deploy
works, but I couldn't figure out the others), but I really don't think having a bunch of separate workflows is worth it just for the pretty badges