@@ -13,29 +13,29 @@ jobs:
13
13
name : Build aarch64-apple-darwin target
14
14
steps :
15
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
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
22
- name : Upload .dylib
23
23
uses : actions/upload-artifact@v3
24
24
with :
25
25
name : aarch64-apple-darwin-dylib
26
26
path : bound/kt/src/main/resources/libtbdex_uniffi_aarch64_apple_darwin.dylib
27
27
28
28
build_x86_64_apple_darwin :
29
- runs-on : macos-latest
29
+ runs-on : macos-12
30
30
name : Build x86_64-apple-darwin target
31
31
steps :
32
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
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
39
- name : Upload .dylib
40
40
uses : actions/upload-artifact@v3
41
41
with :
@@ -46,11 +46,11 @@ jobs:
46
46
runs-on : ubuntu-latest
47
47
name : Build x86_64-unknown-linux-gnu target
48
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
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
54
- name : Upload .so
55
55
uses : actions/upload-artifact@v3
56
56
with :
@@ -61,24 +61,59 @@ jobs:
61
61
runs-on : ubuntu-latest
62
62
name : Build x86_64-unknown-linux-musl target
63
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
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
69
- name : Upload .so
70
70
uses : actions/upload-artifact@v3
71
71
with :
72
72
name : x86_64-unknown-linux-musl-so
73
73
path : bound/kt/src/main/resources/libtbdex_uniffi_x86_64_unknown_linux_musl.so
74
74
75
- test_shared_libraries :
75
+ package_artifact :
76
76
runs-on : ubuntu-latest
77
77
needs :
78
78
- build_aarch64_apple_darwin
79
79
- build_x86_64_apple_darwin
80
80
- build_x86_64_unknown_linux_gnu
81
81
- 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
82
117
strategy :
83
118
matrix :
84
119
target :
@@ -88,20 +123,47 @@ jobs:
88
123
x86_64_unknown_linux_gnu,
89
124
x86_64_unknown_linux_musl,
90
125
]
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
91
136
name : Test on ${{ matrix.target }}
137
+ runs-on : ${{ matrix.os }}
92
138
steps :
93
139
- uses : actions/checkout@v2
94
- - name : Download binaries
140
+ - name : Download Maven artifact
95
141
uses : actions/download-artifact@v3
96
142
with :
97
- name : ${{ matrix.target }}-dylib
98
- path : bound/kt/src/main/resources /
143
+ name : maven-artifact
144
+ path : bound/kt/target /
99
145
- name : Set up JDK 11
100
146
uses : actions/setup-java@v3
101
147
with :
102
148
distribution : " adopt"
103
149
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' }}
105
152
run : |
106
153
cd bound/kt
107
154
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