Skip to content

Commit

Permalink
ci: add MacOS to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
rot256 committed Oct 22, 2024
1 parent 80d0148 commit 5153a59
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,59 @@ on:
push:
branches:
- main
- dev-ci

pull_request:
branches:
- main
- dev-ci

jobs:
build-and-test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy

- name: Cache cargo
id: cache-cargo
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- if: steps.cache-cargo.outputs.cache-hit == 'true'
run: echo "cargo cache hit"

- if: steps.cache-cargo.outputs.cache-hit == 'false'
run: echo "cargo cache miss"

- name: Increase stack size
run: |
echo "Setting stack size to 4MB"
echo "RUST_MIN_STACK=4194304" >> $GITHUB_ENV
- name: Run cargo test
run: cargo test --all-features

- name: Run cargo build
run: cargo build --all

- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run cargo clippy
run: cargo clippy --all -- -D warnings

- name: Build release
run: cargo build --release

- name: CLI Integration tests
run: ./tests/cli/tests.sh

build-and-test-linux:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -48,3 +95,6 @@ jobs:

- name: Build release
run: cargo build --release

- name: CLI Integration tests
run: ./tests/cli/tests.sh
9 changes: 8 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ fn download_executables(config: &Config) {
return;
}

let dist = &DISTS[&(OS.try_into().unwrap(), ARCH.try_into().unwrap())];
// look up the stone-prover distribution for the current OS and architecture
let os = OS.try_into().unwrap();
let arch = ARCH.try_into().unwrap();
let dist = match DISTS.get(&(os, arch)) {
Some(dist) => dist,
None => panic!("Unsupported OS or architecture {}/{}", OS, ARCH),
};

let url = &dist.url;
let download_file_name = Path::new(url)
.file_name()
Expand Down
4 changes: 4 additions & 0 deletions tests/cli/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# CLI Integration Tests
# (might take a while)

0 comments on commit 5153a59

Please sign in to comment.