Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sbihel committed Jan 12, 2024
1 parent d266892 commit e7b55b7
Showing 1 changed file with 86 additions and 0 deletions.
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

0 comments on commit e7b55b7

Please sign in to comment.