12
12
- release-please-**
13
13
14
14
jobs :
15
+ # Run lint and type checks
15
16
run-lint :
16
17
runs-on : ubuntu-latest
17
18
# Run the tests only if It's a PR or if the repo is DIRACGrid/diracx-web
18
19
if : github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web'
19
- defaults :
20
- run :
21
- working-directory : packages/extensions
22
20
steps :
23
21
# Checkout the new source code
24
22
- uses : actions/checkout@v4
@@ -30,15 +28,114 @@ jobs:
30
28
31
29
- name : Install dependencies
32
30
run : npm ci
31
+
32
+ # ========================================================================#
33
+ # WARNING: In your CI/CD pipeline, you should remove the following step #
34
+ # ------------------------------------------------------------------------#
35
+ - name : Build Library
36
+ run : npm run build:diracx-web-components
37
+ # ------------------------------------------------------------------------#
38
+ # ========================================================================#
33
39
34
40
- name : Check code-quality rules
35
- run : npm run lint
41
+ run : npm --prefix packages/extensions run lint
36
42
- name : Check typescript type validity
37
- run : npm run ts-lint
43
+ run : npm --prefix packages/extensions run ts-lint
44
+
45
+ # ============================================================================#
46
+ # WARNING: In your CI/CD pipeline, you should remove the following job #
47
+ # ----------------------------------------------------------------------------#
48
+ prepare-gubbins-as-a-standalone :
49
+ runs-on : ubuntu-latest
50
+ if : ${{ github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web' }}
51
+ steps :
52
+ - uses : actions/checkout@v4
53
+
54
+ - uses : actions/setup-node@v4
55
+ with :
56
+ node-version : ' lts/*'
57
+ registry-url : ' https://registry.npmjs.org'
58
+
59
+ - name : Install dependencies
60
+ run : npm ci
38
61
62
+ - name : Build diracx-web-components
63
+ working-directory : packages/diracx-web-components
64
+ run : |
65
+ npm pack
66
+
67
+ - name : Where the magic happens (Move extensions to a temporary directory)
68
+ run : |
69
+ # Move the library package to the extensions directory
70
+ mv packages/diracx-web-components/*.tgz packages/extensions/diracx-web-components.tgz
71
+ # Move the extensions to the temporary directory
72
+ mv packages/extensions /tmp/extensions
73
+ # Update the package.json to point to the local diracx-web-components
74
+ jq '.dependencies["@dirac-grid/diracx-web-components"] = "file:./diracx-web-components.tgz"' /tmp/extensions/package.json > /tmp/extensions/package.temp.json
75
+ mv /tmp/extensions/package.temp.json /tmp/extensions/package.json
76
+ # Update the package.json to point to the correct postinstall script
77
+ jq '.scripts.postinstall = "node ./node_modules/@axa-fr/react-oidc/bin/copy-service-worker-files.mjs public"' /tmp/extensions/package.json > /tmp/extensions/package.temp.json
78
+ mv /tmp/extensions/package.temp.json /tmp/extensions/package.json
79
+
80
+ - name : Install extensions dependencies
81
+ working-directory : /tmp/extensions
82
+ run : npm install
83
+
84
+ - name : Upload the extensions directory
85
+ uses : actions/upload-artifact@v4
86
+ with :
87
+ name : gubbins
88
+ path : /tmp/extensions
89
+ retention-days : 1
90
+ # ----------------------------------------------------------------------------#
91
+ # In the following jobs, you should: #
92
+ # - Replace /tmp/extensions with the path to your extension source code #
93
+ # - Remove the `needs: prepare-gubbins-as-a-standalone` line #
94
+ # ============================================================================#
95
+
96
+ # Build the extension image
97
+ build-gubbins-dev-image :
98
+ runs-on : ubuntu-latest
99
+ needs : prepare-gubbins-as-a-standalone
100
+ if : ${{ github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web' }}
101
+ steps :
102
+ - uses : actions/checkout@v4
103
+
104
+ - name : Set up QEMU
105
+ uses : docker/setup-qemu-action@v3
106
+ - name : Set up Docker Buildx
107
+ uses : docker/setup-buildx-action@v3
108
+
109
+ - name : Login to GitHub container registry
110
+ uses : docker/login-action@v3
111
+ with :
112
+ registry : ghcr.io
113
+ username : ${{ github.actor }}
114
+ password : ${{ secrets.GITHUB_TOKEN }}
115
+
116
+ # ========================================================================#
117
+ # WARNING: In your CI/CD pipeline, you should remove the following steps #
118
+ # ------------------------------------------------------------------------#
119
+ - name : Download the extensions directory
120
+ uses : actions/download-artifact@v4
121
+ with :
122
+ name : gubbins
123
+ path : /tmp/extensions
124
+ # ------------------------------------------------------------------------#
125
+ # ========================================================================#
126
+
127
+ - name : Build Docker image (extension example)
128
+ uses : docker/build-push-action@v6
129
+ with :
130
+ context : /tmp/extensions
131
+ push : false
132
+ tags : ghcr.io/diracgrid/diracx-web/gubbins:dev
133
+ platforms : linux/amd64,linux/arm64
134
+
135
+ # Run the demo with the extension source code
39
136
run-demo :
40
137
runs-on : ubuntu-latest
41
- # Run the tests only if It's a PR or if the repo is DIRACGrid/diracx-web
138
+ needs : prepare-gubbins-as-a-standalone
42
139
if : github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web'
43
140
steps :
44
141
# Checkout the new source code
@@ -49,14 +146,25 @@ jobs:
49
146
run : |
50
147
cd ..
51
148
git clone https://github.com/aldbr/diracx-charts.git
52
- cd diracx-charts
53
- git switch main_FEAT_npm-workspaces
149
+
150
+ # ========================================================================#
151
+ # WARNING: In your CI/CD pipeline, you should remove the following steps #
152
+ # ------------------------------------------------------------------------#
153
+ - name : Download the extensions directory
154
+ uses : actions/download-artifact@v4
155
+ with :
156
+ name : gubbins
157
+ path : /tmp/extensions
158
+ # ------------------------------------------------------------------------#
159
+ # ========================================================================#
54
160
55
161
# Runs the demo with the extension source code
56
162
- name : Start demo
57
163
run : |
58
164
cd ..
59
- diracx-charts/run_demo.sh --exit-when-done diracx-web/packages/extensions/
165
+ ls -la
166
+ ls -la diracx-charts
167
+ diracx-charts/run_demo.sh --exit-when-done /tmp/extensions/
60
168
61
169
# Prints some debugging information in case something goes wrong
62
170
- name : Debugging information
92
200
with :
93
201
browser : chrome
94
202
config : baseUrl=${{ env.DIRACX_URL }}
95
- project : packages /extensions
203
+ project : /tmp /extensions
0 commit comments