mirror of
https://github.com/Sunscreen-tech/Sunscreen.git
synced 2026-01-10 22:28:14 -05:00
134 lines
4.1 KiB
YAML
134 lines
4.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main, debugger ]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: linux-16core
|
|
|
|
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') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-build-
|
|
${{ runner.os }}-cargo
|
|
- 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') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-mdBook-
|
|
${{ runner.os }}-cargo-
|
|
# 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: Print cargo version
|
|
run: cargo --version
|
|
|
|
- name: Print clang version
|
|
run: clang --version
|
|
|
|
- name: Cargo Format
|
|
run: cargo fmt --check
|
|
|
|
# Check that common feature permutations compile
|
|
- name: Core compile check
|
|
run: cargo check --release -vv
|
|
- name: Full compile check
|
|
run: cargo check --release --features deterministic,linkedproofs,logproof
|
|
|
|
# Build and run the tests
|
|
- name: Build and run tests
|
|
run: cargo test --workspace --verbose --release --features deterministic,linkedproofs,logproof
|
|
|
|
# Build package in prep for user docs
|
|
- name: Build sunscreen and bincode
|
|
run: cargo build --profile mdbook --features bulletproofs,linkedproofs --package sunscreen --package bincode
|
|
# Build mdbook
|
|
- name: Build mdBook
|
|
run: cargo build --release
|
|
working-directory: ./mdBook
|
|
# Build user documentation
|
|
- name: Test docs
|
|
run: ../mdBook/target/release/mdbook test -L dependency=../target/mdbook/deps --extern sunscreen=../target/mdbook/libsunscreen.rlib --extern bincode=../target/mdbook/libbincode.rlib
|
|
working-directory: ./sunscreen_docs
|
|
|
|
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') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-doc-
|
|
${{ runner.os }}-cargo-
|
|
# Check the full documentation builds, links work, etc.
|
|
- name: Cargo doc
|
|
env:
|
|
RUSTDOCFLAGS: -D warnings
|
|
run: cargo doc --release --no-deps --features bulletproofs,linkedproofs,logproof
|
|
emscripten:
|
|
runs-on: linux-8core
|
|
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-emscripten-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-emscripten-
|
|
${{ runner.os }}-cargo-
|
|
- name: Install gcc-multilib (32-bit headers)
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install gcc-multilib
|
|
- name: Emsdk install
|
|
run: emsdk/emsdk/emsdk install 3.1.3
|
|
- name: Emsdk activate
|
|
run: emsdk/emsdk/emsdk activate 3.1.3
|
|
- name: Add Rust wasm32-unknown-emscripten target
|
|
run: rustup target add wasm32-unknown-emscripten
|
|
- name: Build AMM target for Emscripten
|
|
run: source ../../emsdk/emsdk/emsdk_env.sh; cargo build --target wasm32-unknown-emscripten --release
|
|
working-directory: ./examples/amm
|