forked from InseeFrLab/Trevas-Jupyter
-
Notifications
You must be signed in to change notification settings - Fork 0
241 lines (216 loc) · 6.97 KB
/
Copy pathci.yml
File metadata and controls
241 lines (216 loc) · 6.97 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
name: Trevas Jupyter CI
on:
push:
branches:
- "**"
tags:
- "*"
pull_request:
jobs:
check_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin
cache: maven
- uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: maven-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
- name: Check code formatting thanks to Spotless
run: ./mvnw spotless:check
test:
needs: check_format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin
cache: maven
- uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: maven-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
- uses: s4u/maven-settings-action@v4.0.0
with:
githubServer: false
servers: |
[{
"id": "Github",
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
"password": "${{ secrets.GH_PACKAGES_PASSWORD }}"
}]
- name: Test Trevas Jupyter
run: |
chmod +x docker/build-jvm-basekernel-compat.sh
./docker/build-jvm-basekernel-compat.sh
./mvnw test
test_vtl_extension:
needs: check_format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node.js 22
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install jlpm (via JupyterLab)
run: pip install "jupyterlab>=4.4.0,<5"
- name: Install extension dependencies
working-directory: extensions/jupyterlab-vtl-2.1
run: jlpm install --immutable
- name: Run VTL extension unit tests
working-directory: extensions/jupyterlab-vtl-2.1
run: jlpm test
build_vtl_extension:
needs: [check_format, test_vtl_extension]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node.js 22
uses: actions/setup-node@v4
with:
node-version: "22"
cache: yarn
cache-dependency-path: extensions/jupyterlab-vtl-2.1/yarn.lock
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build jupyterlab-vtl-2-1 wheel
run: |
chmod +x docker/build-vtl-extension-wheel.sh
./docker/build-vtl-extension-wheel.sh
- name: Upload VTL extension wheel
uses: actions/upload-artifact@v4
with:
name: vtl-extension-wheel
path: extensions/jupyterlab-vtl-2.1/dist/jupyterlab_vtl_2_1-*.whl
if-no-files-found: error
package:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin
cache: maven
- uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: maven-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
- uses: s4u/maven-settings-action@v4.0.0
with:
githubServer: false
servers: |
[{
"id": "Github",
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
"password": "${{ secrets.GH_PACKAGES_PASSWORD }}"
}]
- name: Package Trevas Jupyter
run: |
chmod +x docker/build-jvm-basekernel-compat.sh
./docker/build-jvm-basekernel-compat.sh
./mvnw package
deploy-dockerhub:
needs: [package, build_vtl_extension]
if: github.repository == 'making-sense-info/trevas-jupyter' &&
startsWith(github.ref, 'refs/tags/v') &&
github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Validate tag format and extract version
id: extract_version
run: |
TAG="${GITHUB_REF#refs/tags/}"
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Tag '$TAG' does not match vX.Y.Z format. Skipping."
exit 1
fi
VERSION="${TAG#v}"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Download VTL extension wheel
uses: actions/download-artifact@v4
with:
name: vtl-extension-wheel
path: extensions/jupyterlab-vtl-2.1/dist
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin
cache: maven
- uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: maven-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
- name: Set current version
run: ./mvnw -B versions:set -DnewVersion=${{ steps.extract_version.outputs.VERSION }} -DprocessAllModules -DgenerateBackupPoms=false
- uses: s4u/maven-settings-action@v4.0.0
with:
githubServer: false
servers: |
[{
"id": "Github",
"username": "${{ secrets.GH_PACKAGES_USERNAME }}",
"password": "${{ secrets.GH_PACKAGES_PASSWORD }}"
}]
- name: Build with Maven
run: |
chmod +x docker/build-jvm-basekernel-compat.sh
./docker/build-jvm-basekernel-compat.sh
./mvnw -B clean package
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v5.7.0
with:
images: makingsenseinfo/trevas-jupyter
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
- name: Login to DockerHub
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6.18.0
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: true
tags: |
makingsenseinfo/trevas-jupyter:${{ steps.extract_version.outputs.VERSION }}
makingsenseinfo/trevas-jupyter:latest
labels: ${{ steps.docker_meta.outputs.labels }}
build-args: |
JUPYTERLAB_VERSION=4.5.8
ELYRA_VERSION=4.1.1
ARBALISTER_VERSION=0.2.1
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}