ci: check Eth LC compiles and use matrix job #229
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: dev | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: CI Test Suite | |
runs-on: warp-ubuntu-latest-x64-32x | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: lurk-lab/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- name: Setup CI | |
uses: ./.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
- name: Run cargo test on *all of* sphinx except the test_e2e_prove_plonk recursion test | |
run: | | |
cargo nextest run --cargo-profile dev-ci --profile ci --workspace --features "plonk" -E 'all() - test(test_e2e_prove_plonk)' | |
- name: Run cargo test with no default features | |
run: | | |
cargo nextest run -p sphinx-core --cargo-profile dev-ci --profile ci --no-default-features --features "debug" -E 'test(cpu::trace::tests)' | |
test-recursion-circuit: | |
name: Test recursion circuit | |
runs-on: warp-ubuntu-latest-x64-32x | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: lurk-lab/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- name: Setup CI | |
uses: ./.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
- name: Run cargo test on the recursion circuit | |
run: | | |
cargo nextest run --cargo-profile dev-ci --profile ci --features "plonk" -E 'package(sphinx-recursion-circuit)' | |
clippy: | |
runs-on: warp-ubuntu-latest-x64-16x | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: lurk-lab/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- name: Setup CI | |
uses: ./.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
- name: Check Rustfmt Code Style | |
run: cargo fmt --all --check | |
- name: check *everything* compiles | |
run: cargo check --all-targets --all-features --all --examples --tests --benches | |
# See '.cargo/config' for list of enabled/disabled clippy lints | |
- name: Check clippy warnings | |
run: cargo xclippy -D warnings | |
- name: Doctests | |
run: cargo test --doc --workspace | |
- name: Cargo-deny | |
uses: EmbarkStudios/cargo-deny-action@v1 | |
integration-tests-examples: | |
name: Build integration tests and examples | |
runs-on: warp-ubuntu-latest-x64-32x | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: lurk-lab/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- name: Setup CI | |
uses: ./.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
perf: false | |
- name: Install deps | |
run: sudo apt update && sudo apt install cmake -y | |
- name: Install `cargo prove` CLI | |
run: | | |
cargo install --locked --force --path ./cli | |
cargo prove install-toolchain | |
working-directory: ${{ github.workspace }} | |
- name: Check examples | |
run: make | |
working-directory: ${{ github.workspace }}/examples | |
- name: Check integration tests | |
run: make | |
working-directory: ${{ github.workspace }}/tests | |
- name: Run cargo prove new | |
run: | | |
cargo prove new cargo-prove-test | |
cd cargo-prove-test/program | |
cat << EOF | tee -a Cargo.toml | |
[patch.'ssh://git@github.com/lurk-lab/sphinx.git'] | |
sphinx-zkvm = { path = "../../zkvm/entrypoint" } | |
EOF | |
cd ../.. | |
cd cargo-prove-test/script | |
cat << EOF | tee -a Cargo.toml | |
[patch.'ssh://git@github.com/lurk-lab/sphinx.git'] | |
sphinx-sdk = { path = "../../sdk" } | |
sphinx-helper = { path = "../../helper" } | |
EOF | |
cargo run --release | |
mac-m1: | |
name: Check OSX ARM compiles | |
runs-on: warp-macos-latest-arm64-6x | |
if: github.event_name != 'pull_request' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: lurk-lab/ci-workflows | |
- uses: ./.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
- name: Setup CI | |
uses: ./.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
- name: Install `cargo prove` CLI | |
run: | | |
cargo install --locked --force --path ./cli | |
cargo prove install-toolchain | |
working-directory: ${{ github.workspace }} | |
- name: Check workspace | |
run: cargo check --all-targets --all-features --workspace | |
- name: Check examples | |
run: make | |
working-directory: ${{ github.workspace }}/examples | |
- name: Check integration tests | |
run: make | |
working-directory: ${{ github.workspace }}/tests | |
- name: Set env | |
if: failure() | |
run: | | |
echo "WORKFLOW_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | tee -a $GITHUB_ENV | |
- name: Open an issue on failure | |
if: failure() | |
uses: JasonEtco/create-an-issue@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_COMMIT: ${{ github.sha }} | |
WORKFLOW_URL: ${{ env.WORKFLOW_URL }} | |
with: | |
filename: .github/templates/M1_MAC.md | |
check-downstream-compiles: | |
runs-on: warp-ubuntu-latest-x64-16x | |
strategy: | |
matrix: | |
include: | |
- repo: zk-light-clients | |
path: aptos | |
- repo: zk-light-clients | |
path: ethereum | |
- repo: loam | |
path: "" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: lurk-lab/ci-workflows | |
path: ci-workflows | |
- uses: ./ci-workflows/.github/actions/ci-env | |
- uses: actions/checkout@v4 | |
with: | |
path: ${{ github.workspace }}/sphinx | |
- name: Setup CI | |
uses: ./sphinx/.github/actions/setup | |
with: | |
pull_token: ${{ secrets.REPO_TOKEN }} | |
perf: false | |
- name: Install deps | |
run: | | |
if [[ "${{ matrix.downstream-path }}" == "aptos" || "${{ matrix.downstream-path }}" == "ethereum" ]]; then | |
sudo apt-get update && sudo apt-get install -y build-essential pkg-config libssl-dev libudev-dev cmake | |
cd sphinx/cli | |
cargo install --locked --force --path . | |
cargo prove install-toolchain | |
echo "RUSTFLAGS=${{env.RUSTFLAGS}} --cfg tokio_unstable" | tee -a $GITHUB_ENV | |
fi | |
- uses: actions/checkout@v4 | |
with: | |
repository: lurk-lab/${{ matrix.repo }} | |
path: ${{ github.workspace }}/${{ matrix.repo }} | |
token: ${{ secrets.REPO_TOKEN }} | |
- uses: ./ci-workflows/.github/actions/check-downstream-compiles | |
with: | |
upstream-path: "sphinx" | |
downstream-path: "${{ matrix.repo }}/${{ matrix.path }}" | |
patch-ssh: true | |