Skip to content

Fix Poseidon V1 suffix-zero collision #19

Fix Poseidon V1 suffix-zero collision

Fix Poseidon V1 suffix-zero collision #19

Workflow file for this run

name: Rust
on:
push:
branches: [main, release/**]
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
complete:
if: always()
needs: [fmt, check-git-rev-deps, build, test, docs, publish-dry-run]
runs-on: ubuntu-slim
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
setup:
runs-on: ubuntu-latest
outputs:
sys: ${{ steps.sys.outputs.sys }}
steps:
- id: sys
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
sys='[
{
"os": "ubuntu-latest",
"target": "x86_64-unknown-linux-gnu"
}
]'
else
sys='[
{
"os": "ubuntu-latest",
"target": "x86_64-unknown-linux-gnu"
},
{
"os": "ubuntu-24.04-arm",
"target": "aarch64-unknown-linux-gnu"
},
{
"os": "macos-15-intel",
"target": "x86_64-apple-darwin"
},
{
"os": "macos-latest",
"target": "aarch64-apple-darwin"
},
{
"os": "windows-latest",
"target": "x86_64-pc-windows-msvc"
}
]'
fi
echo "sys=$(<<< $sys jq -c)" >> $GITHUB_OUTPUT
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update
- run: cargo fmt --all --check
check-git-rev-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-check-git-rev-deps@main
build:
needs: setup
strategy:
fail-fast: false
matrix:
rust: [msrv, latest]
sys: ${{ fromJSON(needs.setup.outputs.sys) }}
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v3
- name: Install minimum supported rust version
if: matrix.rust == 'msrv'
run: |
msrv="$(make msrv)"
rustup install $msrv
rustup component add --toolchain $msrv clippy rustfmt
rustup target add --toolchain $msrv ${{ matrix.sys.target }}
rustup target add --toolchain $msrv wasm32v1-none
- name: Install latest rust version
if: matrix.rust == 'latest'
run: |
rustup update
rustup target add ${{ matrix.sys.target }}
rustup target add wasm32v1-none
- name: Use the minimum supported rust version
if: matrix.rust == 'msrv'
run: echo RUSTUP_TOOLCHAIN="$(make msrv)" >> $GITHUB_ENV
- name: Set latest toolchain
if: matrix.rust == 'latest'
run: echo RUSTUP_TOOLCHAIN="$(rustup show active-toolchain | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: stellar/actions/rust-cache@main
- name: Error on warnings only for msrv
if: matrix.rust == 'msrv'
run: echo RUSTFLAGS='-Dwarnings' >> $GITHUB_ENV
- run: echo CARGO_BUILD_TARGET='${{ matrix.sys.target }}' >> $GITHUB_ENV
- uses: stellar/binaries@v45
with:
name: cargo-hack
version: 0.5.28
- run: cargo version
- run: make build
test:
needs: [setup, build]
strategy:
fail-fast: false
matrix:
rust: [msrv, latest]
sys: ${{ fromJSON(needs.setup.outputs.sys) }}
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v3
- name: Install minimum supported rust version
if: matrix.rust == 'msrv'
run: |
msrv="$(make msrv)"
rustup install $msrv
rustup component add --toolchain $msrv clippy rustfmt
rustup target add --toolchain $msrv ${{ matrix.sys.target }}
rustup target add --toolchain $msrv wasm32v1-none
- name: Install latest rust version
if: matrix.rust == 'latest'
run: |
rustup update
rustup target add ${{ matrix.sys.target }}
rustup target add wasm32v1-none
- name: Use the minimum supported rust version
if: matrix.rust == 'msrv'
run: echo RUSTUP_TOOLCHAIN="$(make msrv)" >> $GITHUB_ENV
- name: Set latest toolchain
if: matrix.rust == 'latest'
run: echo RUSTUP_TOOLCHAIN="$(rustup show active-toolchain | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: stellar/actions/rust-cache@main
- name: Error on warnings only for msrv
if: matrix.rust == 'msrv'
run: echo RUSTFLAGS='-Dwarnings' >> $GITHUB_ENV
- run: echo CARGO_BUILD_TARGET='${{ matrix.sys.target }}' >> $GITHUB_ENV
- uses: stellar/binaries@v45
with:
name: cargo-hack
version: 0.5.28
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- run: rustup update
- run: make doc CARGO_DOC_ARGS=
publish-dry-run:
if: github.event_name == 'push' || startsWith(github.head_ref, 'release/')
strategy:
matrix:
sys:
- os: ubuntu-latest
target: wasm32v1-none
cargo-hack-feature-options: --feature-powerset --exclude-features testutils,default
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cargo-hack-feature-options: --feature-powerset
uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@main
with:
runs-on: ${{ matrix.sys.os }}
target: ${{ matrix.sys.target }}
cargo-hack-feature-options: ${{ matrix.sys.cargo-hack-feature-options }}