Skip to content

Build CI

Build CI #5

Workflow file for this run

name: Build CI
on:
push:
branches: [main, develop]
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
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
MINA_PANIC_ON_BUG: true
CARGO_INCREMENTAL: 1
RUSTFLAGS: "-C overflow-checks=off -C debug-assertions=off"
jobs:
build:
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 ${{ startsWith(matrix.os, 'macos') && '-C link-args=-Wl,-undefined,dynamic_lookup' || '' }}"
steps:
- name: Git checkout
uses: actions/checkout@v5
- name: Setup build dependencies
uses: ./.github/actions/setup-build-deps
- name: Use shared OCaml setting up steps
uses: ./.github/actions/setup-ocaml
with:
ocaml_version: '4.14.2'
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: 1.84
cache-prefix: build-${{ matrix.os }}-${{ matrix.os }}-v0
- name: Release build
run: make build-release
- name: Verify build-info command
run: |
echo "Testing build-info command..."
./target/release/mina build-info
# Verify required fields are present
./target/release/mina build-info | grep -E "Version:|Build time:|Commit SHA:|Commit branch:|Rustc version:"
# Verify version format (should be a short commit hash)
VERSION=$(./target/release/mina build-info | grep "Version:" | awk '{print $2}')
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]]; then
echo "Error: Version should be a 7-character commit hash, got: $VERSION"
exit 1
fi
echo "Build info verification passed!"
build-tests:
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 ${{ startsWith(matrix.os, 'macos') && '-C link-args=-Wl,-undefined,dynamic_lookup' || '' }}"
steps:
- name: Git checkout
uses: actions/checkout@v5
- name: Setup build dependencies
uses: ./.github/actions/setup-build-deps
- name: Use shared OCaml setting up steps
uses: ./.github/actions/setup-ocaml
with:
ocaml_version: '4.14.2'
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: 1.84
cache-prefix: build-tests-${{ matrix.os }}-${{ matrix.os }}-v0
- name: Build tests
run: make build-tests
build-tests-webrtc:
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 ${{ startsWith(matrix.os, 'macos') && '-C link-args=-Wl,-undefined,dynamic_lookup' || '' }}"
steps:
- name: Git checkout
uses: actions/checkout@v5
- name: Setup build dependencies
uses: ./.github/actions/setup-build-deps
- name: Use shared OCaml setting up steps
uses: ./.github/actions/setup-ocaml
with:
ocaml_version: '4.14.2'
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: 1.84
cache-prefix: build-tests-webrtc-${{ matrix.os }}-${{ matrix.os }}-v0
- name: Build tests
run: make build-tests-webrtc
build-benches:
needs: [build]
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 ${{ startsWith(matrix.os, 'macos') && '-C link-args=-Wl,-undefined,dynamic_lookup' || '' }}"
steps:
- name: Git checkout
uses: actions/checkout@v5
- name: Setup build dependencies
uses: ./.github/actions/setup-build-deps
- name: Use shared OCaml setting up steps
uses: ./.github/actions/setup-ocaml
with:
ocaml_version: '4.14.2'
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: 1.84
cache-prefix: build-${{ matrix.os }}-${{ matrix.os }}-v0
- name: Build benchmarks
run: make build-benches
build-wasm:
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
- name: Setup build dependencies
uses: ./.github/actions/setup-build-deps
- name: Use shared OCaml setting up steps
uses: ./.github/actions/setup-ocaml
with:
ocaml_version: '4.14.2'
- name: Setup WebAssembly environment
uses: ./.github/actions/setup-wasm
with:
cache-prefix: wasm-${{ matrix.os }}-${{ matrix.os }}-v0
- name: Release build
run: make build-wasm
env:
RUSTFLAGS: ""