Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Move off macos-12 for builds #41

Move off macos-12 for builds

Move off macos-12 for builds #41

Workflow file for this run

name: CI
on:
push:
branches: main
pull_request:
branches: main
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
target: [ubuntu-20.04, macos-14]
runs-on: ${{ matrix.target }}
steps:
- name: Checkout ironoxide-swig-bindings
uses: actions/checkout@v2
with:
repository: IronCoreLabs/ironoxide-swig-bindings
- name: Checkout ironoxide-swift
uses: actions/checkout@v2
with:
path: ironoxide-swift
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: -p ironoxide-cpp --release
# The following steps move the compiled libironoxide binaries and headers into the proper place in order for them
# to work with Swift. Currently this library expects the headers/binary to be installed on the system via Homebrew
# but a) that won't work for Linux and b) we only publish the iOS binary to Homebrew, not one for MacOS. Therefore
# we do this hacks below so the library can find the right files.
- name: Move libironoxide (OSX)
run: mkdir -p ironoxide-swift/.build/aarch64-apple-darwin/debug && cp target/release/libironoxide.dylib $_
if: matrix.target == 'macos-14'
- name: Move libironoxide (Linux)
run: mkdir -p ironoxide-swift/.build/x86_64-unknown-linux-gnu/debug && cp target/release/libironoxide.so $_
if: matrix.target == 'ubuntu-20.04'
- name: Move header files
run: cp -R cpp/generated/sdk/*.h ironoxide-swift/Sources/libironoxide
- name: Run tests
run: swift test --enable-test-discovery
working-directory: ironoxide-swift