Skip to content

Merge pull request #300 from athenavm/bump-hashbrown #785

Merge pull request #300 from athenavm/bump-hashbrown

Merge pull request #300 from athenavm/bump-hashbrown #785

Workflow file for this run

name: PR
on:
push:
branches: [main]
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-binaries:
name: Build binaries
runs-on: ubuntu-latest
env:
ATHENA_DIR: "${{ github.workspace }}/.athena"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Athena CLI & toolchain
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for authorization to have higher rate-limit.
run: |
cargo install --path cli
cargo athena install-toolchain
- name: Build binaries
run: |
make -C tests
make -C examples
- name: Upload host-test binary
uses: actions/upload-artifact@v4
with:
name: program-binaries
path: |
tests/**/elf/*
examples/**/program/elf/*
test-rust:
name: Test
strategy:
matrix:
runner:
- ubuntu-latest
- [runs-on, runner=8cpu-linux-arm64, "run-id=${{ github.run_id }}"]
- macos-latest
runs-on: ${{ matrix.runner }}
timeout-minutes: 15
env:
ATHENA_DIR: "${{ github.workspace }}/.athena"
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Athena toolchain
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for authorization to have higher rate-limit.
run: cargo run -p athena-cli -- athena install-toolchain
- name: Run cargo check
run: cargo check --all-targets --all-features
- name: Run cargo test
run: cargo test --release
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
RUST_BACKTRACE: 1
test-go:
name: Test (Go)
strategy:
matrix:
runner:
- ubuntu-latest
- [runs-on, runner=8cpu-linux-arm64, "run-id=${{ github.run_id }}"]
- macos-latest
- windows-latest
runs-on: ${{ matrix.runner }}
needs: build-binaries
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: 'ffi/athcon/bindings/go/go.mod'
cache-dependency-path: "**/go.sum"
- name: Download test binaries
uses: actions/download-artifact@v4
with:
name: program-binaries
- name: Run go test
run: |
cd ffi/athcon/bindings/go
go generate
go test -v ./...
lint:
name: Formatting & Clippy
runs-on: ubuntu-latest
needs: build-binaries
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Download test binaries
uses: actions/download-artifact@v4
with:
name: program-binaries
- name: Run cargo clippy
run: cargo clippy --all-features --all-targets -- -D warnings -A incomplete-features
examples:
name: Examples
runs-on: ubuntu-latest
env:
ATHENA_DIR: "${{ github.workspace }}/.athena"
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Athena toolchain
run: |
curl -L https://install.athenavm.org | bash
$ATHENA_DIR/bin/athup --path $GITHUB_WORKSPACE
$ATHENA_DIR/bin/cargo-athena athena --version
echo "$ATHENA_DIR/bin" >> $GITHUB_PATH
- name: Install Athena CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for authorization to have higher rate-limit.
run: |
cargo install --force --locked --path cli
cargo athena install-toolchain
- name: Run cargo check
run: |
RUSTFLAGS="-Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native" \
cargo check --manifest-path examples/Cargo.toml --all-targets --all-features
- name: Compile wallet-template tests
# Note: it's not possible to execute the tests yet as they need a risc-v machine (the VM)
run: RUSTUP_TOOLCHAIN=athena cargo t --manifest-path examples/wallet/program/Cargo.toml --no-run --target riscv32em-athena-zkvm-elf
cli:
name: CLI
runs-on: ubuntu-latest
env:
ATHENA_DIR: "${{ github.workspace }}/.athena"
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Athena toolchain
run: |
curl -L https://install.athenavm.org | bash
$ATHENA_DIR/bin/athup --path $GITHUB_WORKSPACE
$ATHENA_DIR/bin/cargo-athena athena --version
echo "$ATHENA_DIR/bin" >> $GITHUB_PATH
- name: Install Athena CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for authorization to have higher rate-limit.
run: |
cargo install --force --locked --path cli
cargo athena install-toolchain
- name: Run cargo athena new
run: |
cargo athena new fibonacci
- name: Build program and run script
run: |
cd fibonacci/program
cargo add athena-vm --path $GITHUB_WORKSPACE/vm/entrypoint
cargo athena build
cd ../script
cargo add athena-interface --path $GITHUB_WORKSPACE/interface
cargo add athena-sdk --path $GITHUB_WORKSPACE/sdk
RUST_LOG=info cargo run