|
| 1 | +name: Build Shared Libraries |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - kendall/github-mvn-repo |
| 8 | + pull_request: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build_aarch64_apple_darwin: |
| 12 | + runs-on: macos-latest |
| 13 | + name: Build aarch64-apple-darwin target |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v2 |
| 16 | + - name: Install Rust |
| 17 | + run: rustup toolchain install stable |
| 18 | + - name: Run Build Script |
| 19 | + run: | |
| 20 | + cd bindings/tbdex_uniffi/libtargets/aarch64-apple-darwin |
| 21 | + ./build |
| 22 | + - name: Upload .dylib |
| 23 | + uses: actions/upload-artifact@v3 |
| 24 | + with: |
| 25 | + name: aarch64-apple-darwin-dylib |
| 26 | + path: bound/kt/src/main/resources/libtbdex_uniffi_aarch64_apple_darwin.dylib |
| 27 | + |
| 28 | + build_x86_64_apple_darwin: |
| 29 | + runs-on: macos-latest |
| 30 | + name: Build x86_64-apple-darwin target |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v2 |
| 33 | + - name: Install Rust |
| 34 | + run: rustup toolchain install stable |
| 35 | + - name: Run Build Script |
| 36 | + run: | |
| 37 | + cd bindings/tbdex_uniffi/libtargets/x86_64-apple-darwin |
| 38 | + ./build |
| 39 | + - name: Upload .dylib |
| 40 | + uses: actions/upload-artifact@v3 |
| 41 | + with: |
| 42 | + name: x86_64-apple-darwin-dylib |
| 43 | + path: bound/kt/src/main/resources/libtbdex_uniffi_x86_64_apple_darwin.dylib |
| 44 | + |
| 45 | + build_x86_64_unknown_linux_gnu: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + name: Build x86_64-unknown-linux-gnu target |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v2 |
| 50 | + - name: Run Build Script |
| 51 | + run: | |
| 52 | + cd bindings/tbdex_uniffi/libtargets/x86_64-unknown-linux-gnu |
| 53 | + ./build |
| 54 | + - name: Upload .so |
| 55 | + uses: actions/upload-artifact@v3 |
| 56 | + with: |
| 57 | + name: x86_64-unknown-linux-gnu-so |
| 58 | + path: bound/kt/src/main/resources/libtbdex_uniffi_x86_64_unknown_linux_gnu.so |
| 59 | + |
| 60 | + build_x86_64_unknown_linux_musl: |
| 61 | + runs-on: ubuntu-latest |
| 62 | + name: Build x86_64-unknown-linux-musl target |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v2 |
| 65 | + - name: Run Build Script |
| 66 | + run: | |
| 67 | + cd bindings/tbdex_uniffi/libtargets/x86_64-unknown-linux-musl |
| 68 | + ./build |
| 69 | + - name: Upload .so |
| 70 | + uses: actions/upload-artifact@v3 |
| 71 | + with: |
| 72 | + name: x86_64-unknown-linux-musl-so |
| 73 | + path: bound/kt/src/main/resources/libtbdex_uniffi_x86_64_unknown_linux_musl.so |
| 74 | + |
| 75 | + test_shared_libraries: |
| 76 | + runs-on: ubuntu-latest |
| 77 | + needs: |
| 78 | + - build_aarch64_apple_darwin |
| 79 | + - build_x86_64_apple_darwin |
| 80 | + - build_x86_64_unknown_linux_gnu |
| 81 | + - build_x86_64_unknown_linux_musl |
| 82 | + strategy: |
| 83 | + matrix: |
| 84 | + target: |
| 85 | + [ |
| 86 | + aarch64_apple_darwin, |
| 87 | + x86_64_apple_darwin, |
| 88 | + x86_64_unknown_linux_gnu, |
| 89 | + x86_64_unknown_linux_musl, |
| 90 | + ] |
| 91 | + name: Test on ${{ matrix.target }} |
| 92 | + steps: |
| 93 | + - uses: actions/checkout@v2 |
| 94 | + - name: Download binaries |
| 95 | + uses: actions/download-artifact@v3 |
| 96 | + with: |
| 97 | + name: ${{ matrix.target }}-dylib |
| 98 | + path: bound/kt/src/main/resources/ |
| 99 | + - name: Set up JDK 11 |
| 100 | + uses: actions/setup-java@v3 |
| 101 | + with: |
| 102 | + distribution: "adopt" |
| 103 | + java-version: "11" |
| 104 | + - name: Run tests |
| 105 | + run: | |
| 106 | + cd bound/kt |
| 107 | + mvn '-Dtest=SystemArchitectureTest#can load shared library' test |
0 commit comments