Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Build iOS and Android in parallel #51

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 37 additions & 21 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,62 @@
name: Rust
name: Build and Test

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: macos-latest

# TODO: Add a job to run clippy
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check ark-zkey formatting
run: cd ark-zkey/ && cargo fmt --all -- --check
- name: Check mopro-core formatting
run: cd mopro-core/ && cargo fmt --all -- --check
- name: Check mopro-ffi formatting
run: cd mopro-ffi/ && cargo fmt --all -- --check

test-ios:
runs-on: macos-latest
steps:
# TODO: We should be able to cache this
- name: Install circom
run: |
git clone https://github.com/iden3/circom.git
cd circom
cargo build --release
cargo install --path circom
- name: Prepare CI
- uses: actions/checkout@v3
- name: Prepare CI for iOS
run: ./scripts/prepare_ci.sh
- name: Build for iOS
run: ./scripts/build_ios.sh x86_64 debug
- name: Build for android
- name: Run iOS tests
run: |
cd mopro-ios/MoproKit/Example
xcodebuild test -scheme MoproKit-Example -workspace MoproKit.xcworkspace -destination "platform=iOS Simulator,OS=16.2,name=iPhone 14 Pro"

test-android:
runs-on: ubuntu-latest
steps:
- name: Install circom
run: |
git clone https://github.com/iden3/circom.git
cd circom
cargo build --release
cargo install --path circom
- uses: actions/checkout@v3
- name: Prepare CI for Core and FFI
run: ./scripts/prepare_ci.sh
- name: Build for Android
run: ./scripts/build_android.sh arm64 debug
- name: Run core tests
run: cd mopro-core && cargo test -- --nocapture
- name: Run ffi tests
- name: Run FFI tests
# TODO: Fix this custom jar thing
run: |
cd mopro-ffi/
curl -L https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar -o target/jna-5.13.0.jar
CLASSPATH=target/jna-5.13.0.jar cargo test -- --nocapture
- name: Run ios tests
run: |
cd mopro-ios/MoproKit/Example
xcodebuild test -scheme MoproKit-Example -workspace MoproKit.xcworkspace -destination "platform=iOS Simulator,OS=16.2,name=iPhone 14 Pro"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check mopro-core formatting
run: cd ark-zkey/ && cargo fmt --all -- --check
- name: Check mopro-core formatting
run: cd mopro-core/ && cargo fmt --all -- --check
- name: Check mopro-ffi formatting
run: cd mopro-ffi/ && cargo fmt --all -- --check