Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit eb9c3f1

Browse files
committed
Attempt to build shared libs dynamically
1 parent cfb6dbd commit eb9c3f1

File tree

1 file changed

+90
-28
lines changed

1 file changed

+90
-28
lines changed

.github/workflows/gh-mvn-2.yml

+90-28
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@ jobs:
1313
name: Build aarch64-apple-darwin target
1414
steps:
1515
- 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
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
2222
- name: Upload .dylib
2323
uses: actions/upload-artifact@v3
2424
with:
2525
name: aarch64-apple-darwin-dylib
2626
path: bound/kt/src/main/resources/libtbdex_uniffi_aarch64_apple_darwin.dylib
2727

2828
build_x86_64_apple_darwin:
29-
runs-on: macos-latest
29+
runs-on: macos-12
3030
name: Build x86_64-apple-darwin target
3131
steps:
3232
- 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
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
3939
- name: Upload .dylib
4040
uses: actions/upload-artifact@v3
4141
with:
@@ -46,11 +46,11 @@ jobs:
4646
runs-on: ubuntu-latest
4747
name: Build x86_64-unknown-linux-gnu target
4848
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
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
5454
- name: Upload .so
5555
uses: actions/upload-artifact@v3
5656
with:
@@ -61,24 +61,59 @@ jobs:
6161
runs-on: ubuntu-latest
6262
name: Build x86_64-unknown-linux-musl target
6363
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
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
6969
- name: Upload .so
7070
uses: actions/upload-artifact@v3
7171
with:
7272
name: x86_64-unknown-linux-musl-so
7373
path: bound/kt/src/main/resources/libtbdex_uniffi_x86_64_unknown_linux_musl.so
7474

75-
test_shared_libraries:
75+
package_artifact:
7676
runs-on: ubuntu-latest
7777
needs:
7878
- build_aarch64_apple_darwin
7979
- build_x86_64_apple_darwin
8080
- build_x86_64_unknown_linux_gnu
8181
- build_x86_64_unknown_linux_musl
82+
name: Package Maven Artifact
83+
steps:
84+
- uses: actions/checkout@v2
85+
- name: Download aarch64-apple-darwin binary
86+
uses: actions/download-artifact@v3
87+
with:
88+
name: aarch64-apple-darwin-dylib
89+
path: bound/kt/src/main/resources/
90+
- name: Download x86_64-apple-darwin binary
91+
uses: actions/download-artifact@v3
92+
with:
93+
name: x86_64-apple-darwin-dylib
94+
path: bound/kt/src/main/resources/
95+
- name: Download x86_64-unknown-linux-gnu binary
96+
uses: actions/download-artifact@v3
97+
with:
98+
name: x86_64-unknown-linux-gnu-so
99+
path: bound/kt/src/main/resources/
100+
- name: Download x86_64-unknown-linux-musl binary
101+
uses: actions/download-artifact@v3
102+
with:
103+
name: x86_64-unknown-linux-musl-so
104+
path: bound/kt/src/main/resources/
105+
- name: Package Maven Artifact
106+
run: |
107+
cd bound/kt
108+
mvn install -DskipTests=true
109+
- name: Upload Maven artifact
110+
uses: actions/upload-artifact@v3
111+
with:
112+
name: maven-artifact
113+
path: bound/kt/target/
114+
115+
test_shared_libraries:
116+
needs: package_artifact
82117
strategy:
83118
matrix:
84119
target:
@@ -88,20 +123,47 @@ jobs:
88123
x86_64_unknown_linux_gnu,
89124
x86_64_unknown_linux_musl,
90125
]
126+
os: [macos-latest, macos-12, ubuntu-latest, ubuntu-latest]
127+
include:
128+
- target: aarch64_apple_darwin
129+
os: macos-latest
130+
- target: x86_64_apple_darwin
131+
os: macos-12
132+
- target: x86_64_unknown_linux_gnu
133+
os: ubuntu-latest
134+
- target: x86_64_unknown_linux_musl
135+
os: ubuntu-latest
91136
name: Test on ${{ matrix.target }}
137+
runs-on: ${{ matrix.os }}
92138
steps:
93139
- uses: actions/checkout@v2
94-
- name: Download binaries
140+
- name: Download Maven artifact
95141
uses: actions/download-artifact@v3
96142
with:
97-
name: ${{ matrix.target }}-dylib
98-
path: bound/kt/src/main/resources/
143+
name: maven-artifact
144+
path: bound/kt/target/
99145
- name: Set up JDK 11
100146
uses: actions/setup-java@v3
101147
with:
102148
distribution: "adopt"
103149
java-version: "11"
104-
- name: Run tests
150+
- name: Run tests on macOS and Ubuntu
151+
if: ${{ matrix.os != 'ubuntu-latest' || matrix.target != 'x86_64_unknown_linux_musl' }}
105152
run: |
106153
cd bound/kt
107154
mvn '-Dtest=SystemArchitectureTest#can load shared library' test
155+
- name: Run tests on Alpine for x86_64_unknown_linux_musl
156+
if: ${{ matrix.target == 'x86_64_unknown_linux_musl' }}
157+
run: |
158+
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace \
159+
alpine:latest /bin/sh -c "\
160+
apk update && apk add openjdk11 && apk add maven && \
161+
cd bound/kt && \
162+
mvn '-Dtest=SystemArchitectureTest#can load shared library' test"
163+
164+
publish_artifact:
165+
runs-on: ubuntu-latest
166+
needs: test_shared_libraries
167+
name: Publish Maven Artifact
168+
steps:
169+
- run: echo "hello world"

0 commit comments

Comments
 (0)