Skip to content

Consolidate all "build" workflows #1

Consolidate all "build" workflows

Consolidate all "build" workflows #1

Workflow file for this run

name: Build CI

Check failure on line 1 in .github/workflows/build-ci.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-ci.yaml

Invalid workflow file

(Line: 25, Col: 1): Unexpected value 'x-matrix-os', (Line: 25, Col: 14): A mapping was not expected, (Line: 33, Col: 9): Unrecognized named-value: 'matrix'. Located at position 59 within expression: github.event.inputs.os == '' || github.event.inputs.os == matrix.os, (Line: 25, Col: 14): A mapping was not expected, (Line: 79, Col: 9): Unrecognized named-value: 'matrix'. Located at position 59 within expression: github.event.inputs.os == '' || github.event.inputs.os == matrix.os, (Line: 25, Col: 14): A mapping was not expected, (Line: 108, Col: 9): Unrecognized named-value: 'matrix'. Located at position 59 within expression: github.event.inputs.os == '' || github.event.inputs.os == matrix.os, (Line: 25, Col: 14): A mapping was not expected, (Line: 138, Col: 9): Unrecognized named-value: 'matrix'. Located at position 59 within expression: github.event.inputs.os == '' || github.event.inputs.os == matrix.os, (Line: 25, Col: 14): A mapping was not expected
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"
x-matrix-os: &matrix-os
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-13, macos-14, macos-15, macos-latest]
jobs:
build:
strategy:
matrix:
<<: *matrix-os
if: ${{ github.event.inputs.os == '' || github.event.inputs.os == matrix.os }}
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:
<<: *matrix-os
if: ${{ github.event.inputs.os == '' || github.event.inputs.os == matrix.os }}
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:
<<: *matrix-os
if: ${{ github.event.inputs.os == '' || github.event.inputs.os == matrix.os }}
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:
<<: *matrix-os
if: ${{ github.event.inputs.os == '' || github.event.inputs.os == matrix.os }}
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:
<<: *matrix-os
if: ${{ github.event.inputs.os == '' || github.event.inputs.os == matrix.os }}
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: ""