Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
feat!: Call backend via precompiled binaries (#239)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom French <[email protected]>
Co-authored-by: Tom French <[email protected]>
  • Loading branch information
3 people authored Aug 30, 2023
1 parent d37b122 commit f42b5ee
Show file tree
Hide file tree
Showing 28 changed files with 1,205 additions and 4,429 deletions.
100 changes: 36 additions & 64 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,44 @@
name: Test
name: Rust Test

on: [push, pull_request]

# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 40
env:
CACHED_PATH: /tmp/nix-cache

test_ubuntu:
name: Test on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Rust
uses: dtolnay/[email protected]
with:
target: x86_64-unknown-linux-gnu

- name: Run tests
env:
RUST_TEST_THREADS: 1
run: |
cargo test
test_mac:
name: Test on macOS
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-linux
- os: macos-latest
target: x86_64-darwin
target: [x86_64-apple-darwin, aarch64-apple-darwin]

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-22.11
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: cachix/cachix-action@v12
with:
name: barretenberg

- name: Restore nix store cache
uses: actions/cache/restore@v3
id: cache
with:
path: ${{ env.CACHED_PATH }}
key: ${{ runner.os }}-flake-${{ hashFiles('*.lock') }}

# Based on https://github.com/marigold-dev/deku/blob/b5016f0cf4bf6ac48db9111b70dd7fb49b969dfd/.github/workflows/build.yml#L26
- name: Copy cache into nix store
if: steps.cache.outputs.cache-hit == 'true'
# We don't check the signature because we're the one that created the cache
run: |
for narinfo in ${{ env.CACHED_PATH }}/*.narinfo; do
path=$(head -n 1 "$narinfo" | awk '{print $2}')
nix copy --no-check-sigs --from "file://${{ env.CACHED_PATH }}" "$path"
done
- name: Run `nix flake check`
run: |
nix flake check -L
- name: Export cache from nix store
if: ${{ always() && steps.cache.outputs.cache-hit != 'true' }}
run: |
nix copy --to "file:///tmp/nix-cache?compression=zstd&parallel-compression=true" .#native-cargo-artifacts
nix copy --to "file:///tmp/nix-cache?compression=zstd&parallel-compression=true" .#wasm-cargo-artifacts
- uses: actions/cache/save@v3
# Write a cache entry even if the tests fail but don't create any for the merge queue.
if: ${{ always() && steps.cache.outputs.cache-hit != 'true' }}
with:
path: ${{ env.CACHED_PATH }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Rust
uses: dtolnay/[email protected]
with:
target: ${{ matrix.target }}

- name: Run tests
env:
RUST_TEST_THREADS: 1
run: |
cargo test
Loading

0 comments on commit f42b5ee

Please sign in to comment.