-
Notifications
You must be signed in to change notification settings - Fork 170
172 lines (146 loc) · 6.2 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: CI
on: [push, pull_request]
jobs:
linux:
strategy:
fail-fast: false
matrix:
include: [
{ os: ubuntu-latest, target: linux/amd64 }
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: zulu
- name: Install sbt-java-module-info
run: pushd ./sbt-java-module-info; ./sbt publishLocal; popd
- name: Compile
run: ./sbt compile
- name: Env
run: echo "nativeJniVersion=`cat version`" >> $GITHUB_ENV
- name: Inspect
run: ldd target/classes/${{ matrix.target }}/libzstd-jni-${nativeJniVersion}.so
- name: Test
run: ./sbt jacoco
- name: Upload coverage
uses: codecov/codecov-action@v3
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master'}}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
run: aws s3 cp --recursive target/classes/${{ matrix.target }} s3://zstd-jni/github/${{ matrix.target }}
macos:
strategy:
fail-fast: false
matrix:
include: [
{ os: macos-11.0, host_arch: x86_64, macos_target: x86_64-apple-macos10.12, target_arch: x86_64 },
{ os: macos-11.0, host_arch: x86_64, macos_target: arm64-apple-macos11, target_arch: aarch64 }
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: zulu
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Install sbt-java-module-info
run: pushd ./sbt-java-module-info; ./sbt publishLocal; popd
- name: Compile
env:
CC: cc -target ${{ matrix.macos_target }}
run: ./sbt compile
- name: Env
run: echo "nativeJniVersion=`cat version`" >> $GITHUB_ENV
- name: Inspect
if: matrix.target_arch == 'x86_64'
run: otool -L target/classes/darwin/${{ matrix.target_arch }}/libzstd-jni-${nativeJniVersion}.dylib
- name: Symbols
if: matrix.target_arch == 'x86_64'
run: nm -m target/classes/darwin/${{ matrix.target_arch }}/libzstd-jni-${nativeJniVersion}.dylib
- name: Test
if: matrix.target_arch == 'x86_64'
run: ./sbt jacoco
- name: Upload coverage
if: matrix.target_arch == 'x86_64'
uses: codecov/codecov-action@v3
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master'}}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
run: aws s3 cp --recursive target/classes/darwin/${{ matrix.host_arch }} s3://zstd-jni/github/darwin/${{ matrix.target_arch }}
windows:
strategy:
fail-fast: false
matrix:
include: [
{ msystem: MINGW64, arch: x86_64, java_arch: x64, target: 'win\amd64', s3_path: win/amd64 },
{ msystem: MINGW32, arch: i686, java_arch: x86, target: 'win\x86', s3_path: win/x86 }
]
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
install: git base-devel mingw-w64-${{ matrix.arch }}-toolchain
path-type: inherit
update: true
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: zulu
architecture: ${{ matrix.java_arch }}
- name: Check Java version
run: java -version
- name: Install sbt-java-module-info
run: cd ./sbt-java-module-info; ./sbt publishLocal
- name: Compile
run: ./sbt compile
- name: Test
run: ./sbt jacoco
- name: Upload coverage
uses: codecov/codecov-action@v3
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master'}}
shell: cmd
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
run: 'aws s3 cp --recursive target\classes\${{ matrix.target }} s3://zstd-jni/github/${{ matrix.s3_path }}'
windows-cross:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
install: git base-devel mingw-w64-cross-clang
path-type: inherit
update: true
- name: Compile
run: /opt/aarch64-w64-mingw32/bin/aarch64-w64-mingw32-clang -shared -flto -D_JNI_IMPLEMENTATION_ -Wl,--kill-at -O3 -DZSTD_LEGACY_SUPPORT=4 -DZSTD_MULTITHREAD=1 -I./src/windows/include -I./jni -I./src/main/native -I./src/main/native/common -I./src/main/native/legacy -std=c99 -o libzstd-jni-$(cat version).dll ./src/main/native/*.c ./src/main/native/legacy/*.c ./src/main/native/common/*.c ./src/main/native/compress/*.c ./src/main/native/decompress/*.[cS] ./src/main/native/dictBuilder/*.c
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master'}}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
run: aws s3 cp libzstd-jni-$(cat version).dll s3://zstd-jni/github/win/aarch64/libzstd-jni-$(cat version).dll