Skip to content

Fix cargo build (#390) #937

Fix cargo build (#390)

Fix cargo build (#390) #937

Workflow file for this run

name: ci
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
SSI_REF: main
RUSTFLAGS: "-Dwarnings"
defaults:
run:
working-directory: didkit
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout DIDKit repository
uses: actions/checkout@v4
with:
path: didkit
submodules: true
- name: Checkout SSI library
uses: actions/checkout@v4
with:
repository: spruceid/ssi
path: ssi
ref: ${{env.SSI_REF}}
submodules: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
didkit
- name: Install Rust old stable with incremental compilation
uses: actions-rs/toolchain@v1
with:
toolchain: 1.70.0
profile: minimal
default: true
- name: Build
run: cargo build
- name: Test
run: cargo test
- name: Test CLI
run: cli/tests/example.sh
- name: Test CLI with ssh-agent
run: cli/tests/ssh-agent.sh
- name: Test CLI (did:tz)
env:
DID_METHOD: tz
run: cli/tests/example.sh
- name: Test CLI (JWT)
env:
PROOF_FORMAT: jwt
run: cli/tests/example.sh
- name: Test CLI (JWT VC in LDP VP)
env:
VC_PROOF_FORMAT: jwt
run: cli/tests/example.sh
- name: Test CLI (LDP VC in JWT VP)
env:
VP_PROOF_FORMAT: jwt
run: cli/tests/example.sh
- name: Test binary-signing verify example
run: examples/binary-signing/index.sh verify examples/binary-signing/hello.txt examples/binary-signing/hello-vc.jsonld
- name: Install wasm-pack
run: make -C lib install-wasm-pack
- name: Use system JDK
run: echo "$JAVA_HOME/bin" >> $GITHUB_PATH
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'dev'
- name: Opt out of Dart/Flutter analytics
run: |
dart --disable-analytics
flutter --suppress-analytics config --no-analytics
- name: Test C FFI
run: make -C lib ../target/test/c.stamp
- name: Test WASM package
run: make -C lib ../target/test/wasm.stamp
- name: Test JNI
run: make -C lib ../target/test/java.stamp
- name: Test Dart/Flutter plugin
run: make -C lib ../target/test/flutter.stamp
- name: Install Rust Android target
run: rustup target add i686-linux-android
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Install NDK
run: sdkmanager --install "build-tools;33.0.2" "ndk;25.2.9519653" "cmdline-tools;latest"
- name: Install gcc-multilib
run: |
sudo apt update
sudo apt install gcc-multilib -y
- name: Build Android Archive
run: AR=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar RANLIB=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib TARGET_CC=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android19-clang PATH=$ANDROID_SDK_ROOT/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH cargo build --lib --target i686-linux-android
build_ios:
runs-on: macos-latest
steps:
- name: Checkout DIDKit repository
uses: actions/checkout@v4
with:
path: didkit
- name: Checkout SSI library
uses: actions/checkout@v4
with:
repository: spruceid/ssi
path: ssi
ref: ${{env.SSI_REF}}
submodules: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
didkit
- name: Install Rust iOS targets
run: make -C lib install-rustup-ios
- name: Build iOS Library
run: make -C lib ../target/test/ios.stamp
build_windows:
runs-on: windows-latest
steps:
- name: Checkout DIDKit repository
uses: actions/checkout@v4
with:
path: didkit
- name: Checkout SSI library
uses: actions/checkout@v4
with:
repository: spruceid/ssi
path: ssi
ref: ${{env.SSI_REF}}
submodules: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
didkit
- name: Build
run: cargo build