This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to build shared libs dynamically
- Loading branch information
1 parent
45628a5
commit f81a59e
Showing
2 changed files
with
139 additions
and
29 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Build Shared Libraries | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- kendall/github-mvn-repo | ||
pull_request: | ||
|
||
jobs: | ||
build_aarch64_apple_darwin: | ||
runs-on: macos-latest | ||
name: Build aarch64-apple-darwin target | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Rust | ||
run: rustup toolchain install stable | ||
- name: Run Build Script | ||
run: | | ||
cd bindings/tbdex_uniffi/libtargets/aarch64-apple-darwin | ||
./build | ||
- name: Upload .dylib | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: aarch64-apple-darwin-dylib | ||
path: bound/kt/src/main/resources/libtbdex_uniffi_aarch64_apple_darwin.dylib | ||
|
||
build_x86_64_apple_darwin: | ||
runs-on: macos-latest | ||
name: Build x86_64-apple-darwin target | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Rust | ||
run: rustup toolchain install stable | ||
- name: Run Build Script | ||
run: | | ||
cd bindings/tbdex_uniffi/libtargets/x86_64-apple-darwin | ||
./build | ||
- name: Upload .dylib | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: x86_64-apple-darwin-dylib | ||
path: bound/kt/src/main/resources/libtbdex_uniffi_x86_64_apple_darwin.dylib | ||
|
||
build_x86_64_unknown_linux_gnu: | ||
runs-on: ubuntu-latest | ||
name: Build x86_64-unknown-linux-gnu target | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run Build Script | ||
run: | | ||
cd bindings/tbdex_uniffi/libtargets/x86_64-unknown-linux-gnu | ||
./build | ||
- name: Upload .so | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: x86_64-unknown-linux-gnu-so | ||
path: bound/kt/src/main/resources/libtbdex_uniffi_x86_64_unknown_linux_gnu.so | ||
|
||
build_x86_64_unknown_linux_musl: | ||
runs-on: ubuntu-latest | ||
name: Build x86_64-unknown-linux-musl target | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run Build Script | ||
run: | | ||
cd bindings/tbdex_uniffi/libtargets/x86_64-unknown-linux-musl | ||
./build | ||
- name: Upload .so | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: x86_64-unknown-linux-musl-so | ||
path: bound/kt/src/main/resources/libtbdex_uniffi_x86_64_unknown_linux_musl.so | ||
|
||
test_shared_libraries: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build_aarch64_apple_darwin | ||
- build_x86_64_apple_darwin | ||
- build_x86_64_unknown_linux_gnu | ||
- build_x86_64_unknown_linux_musl | ||
strategy: | ||
matrix: | ||
target: | ||
[ | ||
aarch64_apple_darwin, | ||
x86_64_apple_darwin, | ||
x86_64_unknown_linux_gnu, | ||
x86_64_unknown_linux_musl, | ||
] | ||
name: Test on ${{ matrix.target }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download binaries | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ matrix.target }}-dylib | ||
path: bound/kt/src/main/resources/ | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "adopt" | ||
java-version: "11" | ||
- name: Run tests | ||
run: | | ||
cd bound/kt | ||
mvn '-Dtest=SystemArchitectureTest#can load shared library' test |
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