-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from leonardoalt/self_hosted
try self hosted CI
- Loading branch information
Showing
1 changed file
with
50 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,62 @@ | ||
name: Rust | ||
name: Fusion build | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
build_circuit: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: ⚡ Cache Circuits | ||
id: cache-circuits | ||
uses: actions/cache@v3 | ||
with: | ||
path: circuits/ | ||
key: cache-circuits-${{ hashFiles('**/out') }} | ||
- name: Compile circuit | ||
if: steps.cache-circuits.outputs.cache-hit != 'true' | ||
run: cd circuits && zokrates compile -i fusion.zok | ||
- name: Compute trusted setup | ||
if: steps.cache-circuits.outputs.cache-hit != 'true' | ||
run: cd circuits && zokrates setup | ||
|
||
build: | ||
needs: build_circuit | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: ⚡ Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
- name: Set up nightly | ||
run: rustup default nightly-2023-01-03 | ||
- name: Install dependencies | ||
run: rustup component add clippy rustfmt | ||
- name: Build | ||
run: cargo build | ||
- name: Run tests | ||
run: cargo test | ||
- name: Lint | ||
run: cargo clippy --all --all-features -- -D warnings | ||
- name: Format | ||
run: cargo fmt --check --verbose | ||
- uses: actions/checkout@v3 | ||
- name: ⚡ Cache Cargo | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Set up Rust nightly | ||
run: rustup default nightly-2023-01-03 | ||
- name: Install dependencies | ||
run: rustup component add clippy rustfmt | ||
- name: Restore cached circuits | ||
id: cache-circuits | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: circuits/ | ||
key: cache-circuits-${{ hashFiles('**/out') }} | ||
- name: Build | ||
run: cargo build | ||
- name: Run tests | ||
run: cargo test | ||
- name: Lint | ||
run: cargo clippy --all --all-features -- -D warnings | ||
- name: Format | ||
run: cargo fmt --check --verbose |