Skip to content

Add example of importing ark_bn254 in a contract #1145

Add example of importing ark_bn254 in a contract

Add example of importing ark_bn254 in a contract #1145

Workflow file for this run

name: Rust
on:
push:
branches: [main, dev]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}
cancel-in-progress: true
jobs:
complete:
if: always()
needs: [fmt, build-and-test]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
dirs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: dirs
run: |
dirs=$(find . -type f -name 'Makefile' -mindepth 2 | xargs dirname | sed 's|^\./||' | jq -Rnc '[inputs | "\(.)"]')
echo "dirs=$dirs" >> $GITHUB_OUTPUT
outputs:
dirs: ${{ steps.dirs.outputs.dirs }}
fmt:
needs: dirs
strategy:
fail-fast: false
matrix:
working-directory: ${{ fromJSON(needs.dirs.outputs.dirs) }}
defaults:
run:
working-directory: ${{ matrix.working-directory }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup Rust
- run: rustup update
# Setup Deno
- uses: denoland/setup-deno@909cc5acb0fdd60627fb858598759246509fa755 # v2.0.2
with:
deno-version: v2.x
# Fmt
- run: make fmt
- name: Check no diffs exist
run: git add -N . && git diff HEAD --exit-code
build-and-test:
needs: dirs
strategy:
fail-fast: false
matrix:
working-directory: ${{ fromJSON(needs.dirs.outputs.dirs) }}
rust: [msrv, latest]
sys:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
defaults:
run:
working-directory: ${{ matrix.working-directory }}
runs-on: ${{ matrix.sys.os }}
steps:
- uses: actions/checkout@v3
# Setup Rust
- uses: stellar/actions/rust-cache@main
- name: Use the minimum supported Rust version
if: matrix.rust == 'msrv'
run: |
if [ -f "Cargo.toml" ]; then
msrv="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages | map(.rust_version) | map(values) | min')"
rustup override set $msrv
rustup component add clippy --toolchain $msrv
fi
- name: Error on warnings and clippy checks
# Only error on warnings and checks for the msrv, because new versions of
# Rust will frequently add new warnings and checks.
if: matrix.rust == 'msrv'
run: echo RUSTFLAGS='-Dwarnings' >> $GITHUB_ENV
- run: rustup update
- run: cargo version
- run: rustup target add ${{ matrix.sys.target }}
- run: rustup target add wasm32-unknown-unknown
# Setup Deno
- uses: denoland/setup-deno@909cc5acb0fdd60627fb858598759246509fa755 # v2.0.2
with:
deno-version: v2.x
# Setup Stellar CLI
- uses: stellar/stellar-cli@v22.8.0
# Build and Test
- run: make test
env:
CARGO_BUILD_TARGET: ${{ matrix.sys.target }}