Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
name: Reusable Build Workflow
name: Build CI
Copy link
Member

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.


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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"]') }}
Copy link
Author

Choose a reason for hiding this comment

The 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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: ""
19 changes: 0 additions & 19 deletions .github/workflows/build-macos-13.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/build-macos-14.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/build-macos-15.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/build-macos-latest.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/build-ubuntu-22-04.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/build-ubuntu-24-04-arm.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/build-ubuntu-24-04.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/frontend-ci-test.yaml
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!"
45 changes: 45 additions & 0 deletions .github/workflows/frontend-ci.yaml
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"]') }}
Copy link
Author

Choose a reason for hiding this comment

The 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'
Loading
Loading