Apply suggestions from code review #1213
Workflow file for this run
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
name: Build and Test | |
on: | |
push: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
# TODO: Add a job to run clippy | |
lint: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
cli: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install cli | |
run: | | |
cd cli | |
cargo install --path . | |
mopro --help | |
test-ffi-halo2: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Run ffi halo2 tests | |
run: cd mopro-ffi && cargo test --features halo2 --no-default-features | |
test-ffi-circom: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Run ffi circom tests | |
run: cd mopro-ffi && cargo test --features circom --no-default-features | |
test-ffi-ashlang: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Run ffi ashlang tests | |
run: cd mopro-ffi && cargo test --features ashlang --no-default-features | |
test-e2e: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Run e2e circom tests | |
# TODO: Fix this custom jar thing | |
run: | | |
cd test-e2e | |
curl -L https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar -o jna-5.13.0.jar | |
CLASSPATH=jna-5.13.0.jar cargo test --test circom -- --nocapture | |
- name: Run e2e halo2 tests | |
run: CLASSPATH=jna-5.13.0.jar cargo test --test halo2 -- --nocapture | |
build-xcframework: | |
runs-on: macos-latest | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Build iOS xcframework | |
run: cd test-e2e && cargo run --bin ios | |
- name: Cache xcframework | |
id: cache-xcframework | |
uses: actions/cache/save@v4 | |
with: | |
path: test-e2e/MoproiOSBindings | |
key: ${{ github.sha }}-xcframework | |
build-ios-app-device: | |
runs-on: macos-latest | |
needs: build-xcframework | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Restore cached xcframework | |
id: cache-restore-xcframework | |
uses: actions/cache/restore@v4 | |
with: | |
path: test-e2e/MoproiOSBindings | |
key: ${{ github.sha }}-xcframework | |
- name: Build app for device | |
run: xcodebuild -project ./test-e2e/ios/mopro-test.xcodeproj -scheme mopro-test -destination generic/platform=iOS build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | |
build-ios-app-simulator: | |
runs-on: macos-latest | |
needs: build-xcframework | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Restore cached xcframework | |
id: cache-restore-xcframework | |
uses: actions/cache/restore@v4 | |
with: | |
path: test-e2e/MoproiOSBindings | |
key: ${{ github.sha }}-xcframework | |
- name: Build app for device | |
run: xcodebuild -project ./test-e2e/ios/mopro-test.xcodeproj -scheme mopro-test -destination generic/platform=iOS\ Simulator build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | |
test-ios-app-simulator: | |
runs-on: macos-14 | |
needs: build-xcframework | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Restore cached xcframework | |
id: cache-restore-xcframework | |
uses: actions/cache/restore@v4 | |
with: | |
path: test-e2e/MoproiOSBindings | |
key: ${{ github.sha }}-xcframework | |
# to list available simulators: xcrun simctl list devices | |
- name: Test app in simulator | |
run: xcodebuild -project ./test-e2e/ios/mopro-test.xcodeproj -scheme mopro-test -destination 'platform=iOS Simulator,name=iPhone 15' test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | |
build-android-lib: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Build Android bindings | |
run: cd test-e2e && cargo run --bin android | |
- name: Cache android lib | |
id: cache-android-lib | |
uses: actions/cache/save@v4 | |
with: | |
path: test-e2e/MoproAndroidBindings | |
key: ${{ github.sha }}-android-lib | |
build-android-app: | |
runs-on: ubuntu-latest | |
needs: build-android-lib | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Restore cached android lib | |
id: cache-restore-android-lib | |
uses: actions/cache/restore@v4 | |
with: | |
path: test-e2e/MoproAndroidBindings | |
key: ${{ github.sha }}-android-lib | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Setup Android SDK | |
uses: android-actions/[email protected] | |
- name: Build android app | |
run: cd test-e2e/android && ./gradlew build |