clippy fixes and node id support for fhe/zkp compilers #695
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main, debugger ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-build-${{ hashFiles('Cargo.lock') }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
mdBook/target | |
key: ${{ runner.os }}-cargo-mdBook-${{ hashFiles('mdBook/Cargo.lock') }} | |
# Checks are ordered from fastest to slowest so your build fails quickly on invalid PRs | |
# We do everything in release mode so tests run quickly and steps cache each other. | |
# Check the submitted change meets style guidelines | |
- name: Cargo Format | |
run: cargo fmt --check | |
# Build and run the tests | |
- name: Build and run tests | |
run: cargo test --verbose --release | |
# Run our non-interactive examples and assert the complete without error | |
- name: Verify examples (amm) | |
run: cargo run --release --bin amm | |
- name: Verify examples (chi_sq) | |
run: cargo run --release --bin chi_sq | |
- name: Verify examples (simple_multiply) | |
run: cargo run --release --bin simple_multiply | |
- name: Verify examples (dot_prod) | |
run: cargo run --release --bin dot_prod | |
- name: Verify examples (pir) | |
run: cargo run --release --bin pir | |
- name: Build sunscreen and bincode | |
run: cargo build --release --package sunscreen --package bincode | |
- name: Build mdBook | |
run: cargo build --release | |
working-directory: ./mdBook | |
- name: Test docs | |
run: ../mdBook/target/release/mdbook test -L dependency=../target/release/deps --extern sunscreen=../target/release/libsunscreen.rlib --extern bincode=../target/release/libbincode.rlib | |
working-directory: ./sunscreen_docs | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('Cargo.lock') }} | |
# Check the submitted change passes the clippy linter | |
- name: Cargo clippy | |
run: cargo clippy --release --all-targets -- --deny warnings | |
api_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-doc-${{ hashFiles('**/Cargo.lock') }} | |
# Cursory check to ensure your CL contains valid Rust code | |
- name: Cargo check | |
run: cargo check --release | |
# Check the documentation builds, links work, etc. | |
- name: Cargo doc | |
env: | |
RUSTDOCFLAGS: -D warnings | |
run: cargo doc --release --no-deps |