Skip to content
Merged
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
42 changes: 42 additions & 0 deletions .github/actions/load-versions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Load Versions
description: Load version numbers from centralized config file

outputs:
rust-stable:
description: "Rust stable version"
value: ${{ steps.load.outputs.rust-stable }}
rust-nightly:
description: "Rust nightly version"
value: ${{ steps.load.outputs.rust-nightly }}
ocaml-version:
description: "OCaml version"
value: ${{ steps.load.outputs.ocaml-version }}

runs:
using: composite
steps:
- name: Load version configuration
id: load
shell: bash
run: |
VERSIONS_FILE="${{ github.action_path }}/../../config/versions.yaml"

# Read versions from YAML file using yq
RUST_STABLE=$(yq eval '.rust.stable' "$VERSIONS_FILE")
RUST_NIGHTLY=$(yq eval '.rust.nightly' "$VERSIONS_FILE")
OCAML_VERSION=$(yq eval '.ocaml.version' "$VERSIONS_FILE")

# Set outputs
echo "rust-stable=$RUST_STABLE" >> $GITHUB_OUTPUT
echo "rust-nightly=$RUST_NIGHTLY" >> $GITHUB_OUTPUT
echo "ocaml-version=$OCAML_VERSION" >> $GITHUB_OUTPUT

# Also set as environment variables for convenience
echo "RUST_STABLE_VERSION=$RUST_STABLE" >> $GITHUB_ENV
echo "RUST_NIGHTLY_VERSION=$RUST_NIGHTLY" >> $GITHUB_ENV
echo "OCAML_VERSION=$OCAML_VERSION" >> $GITHUB_ENV

echo "Loaded versions:"
echo " Rust stable: $RUST_STABLE"
echo " Rust nightly: $RUST_NIGHTLY"
echo " OCaml: $OCAML_VERSION"
17 changes: 17 additions & 0 deletions .github/config/versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Centralized version definitions for CI workflows
#
# This file serves as the single source of truth for all version numbers
# used across GitHub Actions workflows.
#
# When updating versions here, also update:
# - rust-toolchain.toml (for rust.stable)
# - Makefile (for rust.nightly as NIGHTLY_RUST_VERSION)
# - website/scripts/setup/install-rust.sh
# - website/docs/developers/getting-started.mdx

rust:
stable: "1.84"
nightly: "nightly"

ocaml:
version: "4.14.2"
38 changes: 24 additions & 14 deletions .github/workflows/build-reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
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:
required: false
type: string
Expand Down Expand Up @@ -45,18 +40,21 @@ jobs:
- name: Git checkout
uses: actions/checkout@v5

- name: Load versions
uses: ./.github/actions/load-versions

- 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: ${{ inputs.ocaml_version }}
ocaml_version: ${{ env.OCAML_VERSION }}

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: 1.84
toolchain: ${{ env.RUST_STABLE_VERSION }}
cache-prefix: build-${{ inputs.os }}-${{ inputs.cache-prefix }}v0

- name: Release build
Expand Down Expand Up @@ -88,18 +86,21 @@ jobs:
- name: Git checkout
uses: actions/checkout@v5

- name: Load versions
uses: ./.github/actions/load-versions

- 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: ${{ inputs.ocaml_version }}
ocaml_version: ${{ env.OCAML_VERSION }}

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: 1.84
toolchain: ${{ env.RUST_STABLE_VERSION }}
cache-prefix: build-tests-${{ inputs.os }}-${{ inputs.cache-prefix }}v0

- name: Build tests
Expand All @@ -114,18 +115,21 @@ jobs:
- name: Git checkout
uses: actions/checkout@v5

- name: Load versions
uses: ./.github/actions/load-versions

- 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: ${{ inputs.ocaml_version }}
ocaml_version: ${{ env.OCAML_VERSION }}

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: 1.84
toolchain: ${{ env.RUST_STABLE_VERSION }}
cache-prefix: build-tests-webrtc-${{ inputs.os }}-${{ inputs.cache-prefix }}v0

- name: Build tests
Expand All @@ -141,18 +145,21 @@ jobs:
- name: Git checkout
uses: actions/checkout@v5

- name: Load versions
uses: ./.github/actions/load-versions

- 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: ${{ inputs.ocaml_version }}
ocaml_version: ${{ env.OCAML_VERSION }}

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: 1.84
toolchain: ${{ env.RUST_STABLE_VERSION }}
cache-prefix: build-${{ inputs.os }}-${{ inputs.cache-prefix }}v0

- name: Build benchmarks
Expand All @@ -166,13 +173,16 @@ jobs:
- name: Git checkout
uses: actions/checkout@v5

- name: Load versions
uses: ./.github/actions/load-versions

- 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: ${{ inputs.ocaml_version }}
ocaml_version: ${{ env.OCAML_VERSION }}

- name: Setup WebAssembly environment
uses: ./.github/actions/setup-wasm
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/doc-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@ concurrency:
jobs:
test-doc-commands:
runs-on: ubuntu-22.04
strategy:
matrix:
ocaml_version: [4.14.2]
steps:
- name: Git checkout
uses: actions/checkout@v5

- name: Load versions
uses: ./.github/actions/load-versions

- name: Setup build dependencies
uses: ./.github/actions/setup-build-deps

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
components: rustfmt
toolchain: 1.84
toolchain: ${{ env.RUST_STABLE_VERSION }}
cache-prefix: test-doc-commands-v0

- name: Use shared OCaml setting up steps
uses: ./.github/actions/setup-ocaml
with:
ocaml_version: ${{ matrix.ocaml_version }}
ocaml_version: ${{ env.OCAML_VERSION }}

- name: Download circuits files
uses: ./.github/actions/setup-circuits
Expand Down
33 changes: 16 additions & 17 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,59 @@ on:
jobs:
lint:
timeout-minutes: 10
name: Lint - ${{ matrix.os }} - Rust ${{ matrix.toolchain }}
name: Lint - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
ocaml_version: [4.14.2]
os: [ubuntu-24.04]
toolchain: [1.84]
steps:
- uses: actions/checkout@v5

- name: Load versions
uses: ./.github/actions/load-versions

- 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: ${{ matrix.ocaml_version }}
ocaml_version: ${{ env.OCAML_VERSION }}
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: ${{ matrix.toolchain }}
toolchain: ${{ env.RUST_STABLE_VERSION }}
components: clippy, rustfmt
cache-prefix: lint-${{ matrix.toolchain }}-v0
cache-prefix: lint-${{ env.RUST_STABLE_VERSION }}-v0
- name: Run make check
run: make check
- name: Run make lint
run: make lint

lint-tx-fuzzing:
timeout-minutes: 10
name: Lint transaction Fuzzing - ${{ matrix.os }} - Rust ${{ matrix.toolchain }}
name: Lint transaction Fuzzing - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04]
# This should be in line with the verison in:
# - Makefile
# - ./github/workflows/docs.yaml
# - ./github/workflows/fmt.yaml
# - ./github/workflows/lint.yaml
toolchain: [nightly]
ocaml_version: [4.14.2]
steps:
- uses: actions/checkout@v5

- name: Load versions
uses: ./.github/actions/load-versions

- 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: ${{ matrix.ocaml_version }}
ocaml_version: ${{ env.OCAML_VERSION }}
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
toolchain: ${{ matrix.toolchain }}
toolchain: ${{ env.RUST_NIGHTLY_VERSION }}
components: clippy, rustfmt
cache-prefix: lint-tx-fuzzing-${{ matrix.toolchain }}-v0
cache-prefix: lint-tx-fuzzing-${{ env.RUST_NIGHTLY_VERSION }}-v0
- name: Run transaction Fuzzing check
run: make check-tx-fuzzing

Expand Down
Loading
Loading