0.3.2 #11
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
# This is based on | |
# <https://github.com/ongardie/cubicle/blob/b307fe9/.github/workflows/main.yaml> | |
# with Diego's permission. The initial workflow YAML skeleton before that was | |
# based on | |
# <https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml> | |
# and | |
# <https://github.com/ramosbugs/oauth2-rs/blob/main/.github/workflows/main.yml>. | |
# | |
# GitHub Actions workflow syntax documentation is here: | |
# <https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions>. | |
name: CI | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- main | |
workflow_dispatch: {} | |
env: | |
INSTALL_RUST_VERSION: "1.75" | |
jobs: | |
swift-package: | |
name: Swift Package | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Show cargo package versions before cache unpack | |
run: cargo install --list && cbindgen -V && which cbindgen | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
default: true | |
profile: minimal | |
toolchain: ${{ env.INSTALL_RUST_VERSION }} | |
- name: Show cargo package versions before cache unpack | |
run: cargo install --list && cbindgen -V && which cbindgen | |
- name: Use Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Show cached cargo package versions | |
run: cargo install --list && cbindgen -V && which cbindgen | |
- name: Install cbindgen | |
# keep this version in sync with the one in Cargo.toml | |
run: cargo install cbindgen --version 0.26.0 --force | |
- name: Show cargo package versions | |
run: cargo install --list && cbindgen -V && which cbindgen | |
- name: Build juicebox_sdk_ffi | |
run: swift/ffi.sh --debug --verbose --verify | |
- name: Build and Test | |
run: swift test -v | |
working-directory: swift | |
swift-pod: | |
name: Swift Pod | |
runs-on: macOS-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Swiftlint | |
run: | | |
brew install swiftlint | |
- name: Lint | |
run: swiftlint lint --strict --reporter github-actions-logging | |
working-directory: swift | |
- name: Install Rust | |
run: | | |
rustup toolchain install ${{ env.INSTALL_RUST_VERSION }} --profile minimal --target x86_64-apple-ios,aarch64-apple-ios,aarch64-apple-ios-sim | |
rustup default ${{ env.INSTALL_RUST_VERSION }} | |
- name: Use Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build juicebox_sdk_ffi | |
run: | | |
CARGO_BUILD_TARGET=x86_64-apple-ios ./swift/ffi.sh --release --verbose | |
CARGO_BUILD_TARGET=aarch64-apple-ios ./swift/ffi.sh --release --verbose | |
CARGO_BUILD_TARGET=aarch64-apple-ios-sim ./swift/ffi.sh --release --verbose | |
- name: Run pod lint | |
run: pod lib lint --verbose --allow-warnings | |
rust: | |
name: Rust | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
components: rustfmt, clippy, rust-src | |
default: true | |
profile: minimal | |
toolchain: ${{ env.INSTALL_RUST_VERSION }} | |
- name: Use Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
- name: Run cargo test | |
uses: actions-rs/cargo@v1 | |
with: | |
args: --workspace | |
command: test | |
env: | |
RUST_BACKTRACE: '1' | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
with: | |
args: --all -- --check | |
command: fmt | |
- name: Run clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
args: --workspace --tests -- -D warnings | |
command: clippy | |
- name: Software Realm | |
uses: ./.github/actions/software-realm | |
- name: Run software realm integration tests | |
uses: actions-rs/cargo@v1 | |
with: | |
args: -p juicebox_sdk software_realm --features software_realm_tests | |
command: test | |
- name: Build no_std | |
uses: actions-rs/cargo@v1 | |
env: | |
# Enable nightly features on stable cargo/rustc for build-std. | |
RUSTC_BOOTSTRAP: 1 | |
with: | |
args: -p juicebox_realm_api -p juicebox_marshalling -p juicebox_noise -p juicebox_secret_sharing -p juicebox_oprf -Z build-std=core,alloc --target x86_64-unknown-linux-gnu | |
command: build | |
jni: | |
name: Android | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
run: | | |
rustup toolchain install ${{ env.INSTALL_RUST_VERSION }} --profile minimal --target aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android,i686-linux-android | |
rustup default ${{ env.INSTALL_RUST_VERSION }} | |
- name: Use Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build juicebox_sdk_jni | |
run: ./android/jni.sh | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: 'adopt' | |
cache: 'gradle' | |
- name: Build Android | |
run: ./gradlew build | |
working-directory: android | |
wasm: | |
name: Wasm | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
default: true | |
profile: minimal | |
toolchain: ${{ env.INSTALL_RUST_VERSION }} | |
- name: Use Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- uses: jetli/[email protected] | |
- name: Run Tests | |
run: WASM_BINDGEN_TEST_TIMEOUT=60 wasm-pack test --firefox --headless rust/sdk/bridge/wasm |