mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 05:13:08 +00:00
feat: make CI more granular
This commit is contained in:
parent
081a366c16
commit
d126dac303
10
.github/actions/install-risc0/action.yml
vendored
Normal file
10
.github/actions/install-risc0/action.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
name: Install risc0
|
||||
description: Installs risc0 in the environment
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install risc0
|
||||
run: |
|
||||
curl -L https://risczero.com/install | bash
|
||||
/home/runner/.risc0/bin/rzup install
|
||||
shell: bash
|
||||
10
.github/actions/install-system-deps/action.yml
vendored
Normal file
10
.github/actions/install-system-deps/action.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
name: Install system dependencies
|
||||
description: Installs system dependencies in the environment
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential clang libclang-dev libssl-dev pkg-config
|
||||
shell: bash
|
||||
88
.github/workflows/ci.yml
vendored
88
.github/workflows/ci.yml
vendored
@ -14,25 +14,83 @@ on:
|
||||
name: General
|
||||
|
||||
jobs:
|
||||
ubuntu-latest-pipeline:
|
||||
fmt-rs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
|
||||
name: ubuntu-latest-pipeline
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install system dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y build-essential clang libclang-dev libssl-dev pkg-config
|
||||
|
||||
- name: Install active toolchain
|
||||
run: rustup install
|
||||
|
||||
- name: Install nightly toolchain for rustfmt
|
||||
run: rustup install nightly --profile minimal --component rustfmt
|
||||
|
||||
- name: lint - ubuntu-latest
|
||||
run: chmod 777 ./ci_scripts/lint-ubuntu.sh && ./ci_scripts/lint-ubuntu.sh
|
||||
- name: test ubuntu-latest
|
||||
if: success() || failure()
|
||||
run: chmod 777 ./ci_scripts/test-ubuntu.sh && ./ci_scripts/test-ubuntu.sh
|
||||
- name: Check Rust files are formatted
|
||||
run: cargo +nightly fmt --check
|
||||
|
||||
fmt-toml:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install taplo-cli
|
||||
run: cargo install --locked taplo-cli
|
||||
|
||||
- name: Check TOML files are formatted
|
||||
run: taplo fmt --check .
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
name: lint
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: ./.github/actions/install-system-deps
|
||||
|
||||
- uses: ./.github/actions/install-risc0
|
||||
|
||||
- name: Install active toolchain
|
||||
run: rustup install
|
||||
|
||||
- name: Lint workspace
|
||||
env:
|
||||
RISC0_SKIP_BUILD: "1"
|
||||
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||
|
||||
- name: Lint programs
|
||||
env:
|
||||
RISC0_SKIP_BUILD: "1"
|
||||
run: cargo clippy -p "*programs" -- -D warnings
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 120
|
||||
|
||||
name: test
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: ./.github/actions/install-system-deps
|
||||
|
||||
- uses: ./.github/actions/install-risc0
|
||||
|
||||
- name: Install active toolchain
|
||||
run: rustup install
|
||||
|
||||
- name: Unit tests
|
||||
env:
|
||||
RISC0_DEV_MODE: "1"
|
||||
run: cargo test --workspace --features no_docker
|
||||
|
||||
- name: Test valid proof
|
||||
env:
|
||||
NSSA_WALLET_HOME_DIR: ./integration-tests/configs/debug/wallet
|
||||
RUST_LOG: "info"
|
||||
run: cargo run --bin integration-tests -- ./integration-tests/configs/debug/ test_success_private_transfer_to_another_owned_account
|
||||
|
||||
- name: Integration tests
|
||||
env:
|
||||
NSSA_WALLET_HOME_DIR: ./integration-tests/configs/debug/wallet
|
||||
RUST_LOG: "info"
|
||||
RISC0_DEV_MODE: "1"
|
||||
run: cargo run --bin integration-tests -- ./integration-tests/configs/debug/ all
|
||||
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
set -e
|
||||
curl -L https://risczero.com/install | bash
|
||||
/Users/runner/.risc0/bin/rzup install
|
||||
RUSTFLAGS="-D warnings" cargo build
|
||||
@ -1,4 +0,0 @@
|
||||
set -e
|
||||
curl -L https://risczero.com/install | bash
|
||||
/home/runner/.risc0/bin/rzup install
|
||||
RUSTFLAGS="-D warnings" cargo build
|
||||
@ -1,10 +0,0 @@
|
||||
set -e
|
||||
|
||||
cargo +nightly fmt -- --check
|
||||
|
||||
cargo install taplo-cli --locked
|
||||
taplo fmt --check
|
||||
|
||||
RISC0_SKIP_BUILD=1 cargo clippy --workspace --all-targets -- -D warnings
|
||||
# Lint all programs individually to avoid feature unification issues
|
||||
RISC0_SKIP_BUILD=1 cargo clippy -p "*programs" -- -D warnings
|
||||
@ -1,17 +0,0 @@
|
||||
set -e
|
||||
|
||||
curl -L https://risczero.com/install | bash
|
||||
/home/runner/.risc0/bin/rzup install
|
||||
|
||||
RISC0_DEV_MODE=1 cargo test --release --features no_docker
|
||||
|
||||
cd integration_tests
|
||||
export NSSA_WALLET_HOME_DIR=$(pwd)/configs/debug/wallet/
|
||||
export RUST_LOG=info
|
||||
echo "Try test valid proof at least once"
|
||||
cargo run $(pwd)/configs/debug test_success_private_transfer_to_another_owned_account
|
||||
echo "Continuing in dev mode"
|
||||
RISC0_DEV_MODE=1 cargo run $(pwd)/configs/debug all
|
||||
cd ..
|
||||
|
||||
cd nssa/program_methods/guest && cargo test --release
|
||||
Loading…
x
Reference in New Issue
Block a user