Skip to content

Commit

Permalink
Merge pull request #74 from leonardoalt/self_hosted
Browse files Browse the repository at this point in the history
try self hosted CI
  • Loading branch information
leonardoalt authored Feb 14, 2023
2 parents 44b883d + e7fcaee commit 1232ea4
Showing 1 changed file with 50 additions and 25 deletions.
75 changes: 50 additions & 25 deletions .github/workflows/rust.yml
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

0 comments on commit 1232ea4

Please sign in to comment.