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

Add CI #2

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
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
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: ci

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"
CLASSPATH: "./jna-5.14.0.jar"

jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: Build
run: cargo build

- uses: swift-actions/setup-swift@v1
- name: Download JNA
run: wget https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar
- name: Test
run: cargo test

- name: Fmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy

kotlin:
runs-on: ubuntu-latest
needs: rust
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: "aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android,i686-linux-android"
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"

- uses: taiki-e/install-action@v2
with:
tool: cargo-ndk
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Run tests
uses: gradle/gradle-build-action@v2
with:
arguments: test
build-root-directory: ./kotlin

swift:
runs-on: macos-latest
needs: rust
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: "aarch64-apple-ios-sim,aarch64-apple-ios,x86_64-apple-ios"
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"

- uses: taiki-e/install-action@v2
with:
tool: cargo-swift

- name: Generate Swift package
run: cargo swift package -p ios -n WalletSdkRs
- name: Fail if generated swift code needs update
run: git diff --exit-code WalletSdkRs/Sources/WalletSdkRs/wallet_sdk_rs.swift

This file was deleted.