Skip to content

fmt and fix ci

fmt and fix ci #28

Workflow file for this run

name: ci
on:
push:
branches:
- rust_rewrite
env:
RUSTFLAGS: "-Dwarnings"
RUST_BACKTRACE: 1
jobs:
build-rust:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
workspaces: "expander_compiler -> expander_compiler/target"
- name: Build
run: cargo build --release --manifest-path=expander_compiler/ec_go_lib/Cargo.toml
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}
path: expander_compiler/target/release/libec_go_lib.*
upload-rust:
needs: build-rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
pattern: build-*
merge-multiple: true
- name: Push built libs to another branch
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout --orphan rust-built-libs
cp artifacts/libec_go_lib.* ./
rm ./libec_go_lib.d
git rm --cached -r .
git add ./libec_go_lib.* -f
git commit -m "Add built libs"
git push -f --set-upstream origin rust-built-libs
test-rust:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [7950x3d, macos-latest]
steps:
- uses: styfle/[email protected]
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
workspaces: "expander_compiler -> expander_compiler/target"
- run: cargo test --manifest-path=expander_compiler/Cargo.toml
test-go:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
needs: build-rust
steps:
- uses: styfle/[email protected]
- uses: actions/checkout@v4
- name: Setup Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
pattern: build-${{ matrix.os }}
merge-multiple: true
- run: |
cp artifacts/libec_go_lib.* ecgo/rust/wrapper/
cd ecgo
go test ./test/
test-go-keccak-full:
runs-on: 7950x3d
needs: build-rust
steps:
- uses: styfle/[email protected]
- uses: actions/checkout@v4
- name: Setup Go 1.21.x
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
pattern: build-ubuntu-latest
merge-multiple: true
- run: |
cp artifacts/libec_go_lib.* ecgo/rust/wrapper/
cd ecgo
go run examples/keccak_full/main.go
lint:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- run: cargo fmt --all --manifest-path=expander_compiler/Cargo.toml -- --check
- run: cargo clippy --manifest-path=expander_compiler/Cargo.toml