-
Notifications
You must be signed in to change notification settings - Fork 1
265 lines (233 loc) · 7.82 KB
/
ci.yml
File metadata and controls
265 lines (233 loc) · 7.82 KB
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
---
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on: push
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
- os: macos-12
- os: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Cache build
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.m2/repository
target
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin
cache: maven
- uses: actions/setup-python@v3
with:
python-version: 3.7
- run: python scripts/get_native_libraries.py
- name: Build with Maven
run: mvn -B package --file pom.xml '-Dtest=!TestFindexCloud,!TestRedis,!Redis,!TestConditionalUpsert,!TestDemo,!TestNativeCoverCrypt,!TestKmsCoverCrypt,Test*'
build_in_docker:
services:
kms:
image: ghcr.io/cosmian/kms:4.13.0
ports:
- 9998:9998
findex_cloud:
image: ghcr.io/cosmian/findex_cloud:0.3.1
ports:
- 8080:8080
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
runs-on: ${{ matrix.os }}
container: centos:centos7.4.1708
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Cache build
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.m2/repository
target
key: ${{ runner.os }}-maven-docker-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-docker-${{ hashFiles('**/pom.xml') }}
- run: yum -y install java-1.8.0-openjdk maven python3 python3-pip
- run: python3 scripts/get_native_libraries.py
- name: Display ldd version
run: |
ldd --version
ldd src/main/resources/linux-x86-64/libcloudproof.so
- name: Build with Maven
run: mvn compile
env:
COSMIAN_SERVER_URL: http://kms:9998
COSMIAN_FINDEX_CLOUD_BASE_URL: http://findex_cloud:8080
REDIS_HOSTNAME: redis
REDIS_PORT: 6379
LANG: en_US.UTF-8
LANGUAGE: en_US:en
LC_ALL: en_US.UTF-8
- name: Package and test with Maven
run: |
mvn package
mvn dependency:copy-dependencies
env:
COSMIAN_SERVER_URL: http://kms:9998
COSMIAN_FINDEX_CLOUD_BASE_URL: http://findex_cloud:8080
REDIS_HOSTNAME: redis
REDIS_PORT: 6379
LANG: en_US.UTF-8
LANGUAGE: en_US:en
LC_ALL: en_US.UTF-8
- name: Upload dependencies and source
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v3
with:
name: cloudproof_java_${{ github.ref_name }}
path: |
.
!.git
!.mypy_cache
retention-days: 1
if-no-files-found: error
- name: Bench with Maven
if: startsWith(github.ref, 'refs/tags/')
run: mvn test -Dtest='TestBenchesCoverCrypt'
env:
COSMIAN_SERVER_URL: http://kms:9998
COSMIAN_FINDEX_CLOUD_BASE_URL: http://findex_cloud:8080
REDIS_HOSTNAME: redis
REDIS_PORT: 6379
LANG: en_US.UTF-8
LANGUAGE: en_US:en
LC_ALL: en_US.UTF-8
- name: Upload non-regression test vectors
uses: actions/upload-artifact@v3
with:
name: cloudproof_java
path: |
./target/non_regression_vector.json
./target/sqlite.db
retention-days: 1
if-no-files-found: error
cloudproof_js:
needs: build_in_docker
uses: Cosmian/reusable_workflows/.github/workflows/cloudproof_js.yml@develop
with:
branch: develop
target: wasm32-unknown-unknown
kms-version: ghcr.io/cosmian/kms:4.13.0
findex-cloud-version: 0.3.1
copy_fresh_build: false
copy_regression_files: |
cp ./cloudproof_java/non_regression_vector.json tests/data/cover_crypt/non_regression/java_non_regression_vector.json
cp ./cloudproof_java/sqlite.db tests/data/findex/non_regression/java_sqlite.db
cloudproof_python:
needs: build_in_docker
uses: Cosmian/reusable_workflows/.github/workflows/cloudproof_python.yml@develop
with:
branch: develop
target: x86_64-unknown-linux-gnu
kms-version: ghcr.io/cosmian/kms:4.13.0
findex-cloud-version: 0.3.1
copy_fresh_build: false
copy_regression_files: |
cp ./cloudproof_java/non_regression_vector.json tests/data/cover_crypt/non_regression/java_non_regression_vector.json
cp ./cloudproof_java/sqlite.db tests/data/findex/non_regression/java_sqlite.db
cloudproof_flutter:
needs: build_in_docker
uses: Cosmian/reusable_workflows/.github/workflows/cloudproof_flutter.yml@develop
with:
branch: develop
target: x86_64-unknown-linux-gnu
extension: so
copy_fresh_build: false
copy_regression_files: |
cp ./cloudproof_java/non_regression_vector.json test/resources/cover_crypt/non_regression/java_non_regression_vector.json
cp ./cloudproof_java/sqlite.db test/resources/findex/non_regression/java_sqlite.db
maven_deploy:
needs:
- build
- cloudproof_js
- cloudproof_flutter
- cloudproof_python
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Cache build
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.m2/repository
target
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin
cache: maven
- uses: actions/setup-python@v3
with:
python-version: 3.7
- run: python scripts/get_native_libraries.py
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Maven deploy
if: startsWith(github.ref, 'refs/tags/')
run: |
sudo apt-get update
sudo apt-get install -y gnupg2
mkdir -p ~/.m2 ~/.gpg
echo "$M2_SETTINGS" > ~/.m2/settings.xml
echo "$MAVEN_GPG_PRIVATE_KEY" > ~/.gpg/maven_gpg_private_key.asc
mvn clean deploy -Dmaven.test.skip
env:
M2_SETTINGS: ${{ secrets.M2_SETTINGS }}
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
release:
needs:
- maven_deploy
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
cleanup:
needs:
- release
uses: Cosmian/reusable_workflows/.github/workflows/cleanup_cache.yml@main
secrets: inherit