File tree 5 files changed +48
-4
lines changed
5 files changed +48
-4
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,14 @@ runs:
30
30
uses : actions/cache@v2
31
31
with :
32
32
path : /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/packages/requester-node-http/dist
33
- key : ${{ runner.os }}-1-js-node-requester -${{ hashFiles('clients/algoliasearch-client-javascript/packages/requester-node-http/**') }}
33
+ key : ${{ runner.os }}-1-js-requester- node-http -${{ hashFiles('clients/algoliasearch-client-javascript/packages/requester-node-http/**') }}
34
34
35
35
- name : Restore built JavaScript browser requester
36
36
if : ${{ inputs.job == 'cts' }}
37
37
uses : actions/cache@v2
38
38
with :
39
39
path : /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/packages/requester-browser-xhr/dist
40
- key : ${{ runner.os }}-1-js-browser-requester -${{ hashFiles('clients/algoliasearch-client-javascript/packages/requester-browser-xhr/**') }}
40
+ key : ${{ runner.os }}-1-js-requester- browser-xhr -${{ hashFiles('clients/algoliasearch-client-javascript/packages/requester-browser-xhr/**') }}
41
41
42
42
- name : Restore built JavaScript search client
43
43
if : ${{ inputs.job == 'cts' }}
Original file line number Diff line number Diff line change 38
38
echo "::set-output name=SCRIPTS_CHANGED::$(git diff --shortstat origin/${{ github.base_ref }}..HEAD -- scripts | wc -l)"
39
39
40
40
echo "::set-output name=JS_CLIENT_CHANGED::$(git diff --shortstat origin/${{ github.base_ref }}..HEAD -- clients/algoliasearch-client-javascript | wc -l)"
41
+ echo "::set-output name=JS_COMMON_CHANGED::$(git diff --shortstat origin/${{ github.base_ref }}..HEAD -- clients/algoliasearch-client-javascript/packages/client-common clients/algoliasearch-client-javascript/packages/requester-browser-xhr clients/algoliasearch-client-javascript/packages/requester-node-http | wc -l)"
41
42
echo "::set-output name=JS_TEMPLATE_CHANGED::$(git diff --shortstat origin/${{ github.base_ref }}..HEAD -- templates/javascript | wc -l)"
42
43
43
44
echo "::set-output name=JAVA_CLIENT_CHANGED::$(git diff --shortstat origin/${{ github.base_ref }}..HEAD -- clients/algoliasearch-client-java-2 | wc -l)"
80
81
echo "::set-output name=MATRIX::$matrix"
81
82
echo "::set-output name=RUN_CLIENT::$run"
82
83
84
+ if [[ $base_changed == 'true' || steps.diff.outputs.JS_COMMON_CHANGED > 0 ]]; then
85
+ echo "::set-output name=RUN_COMMON::true"
86
+ fi
87
+
83
88
- name : Compute the Java client build matrix
84
89
id : java-matrix
85
90
shell : bash
@@ -127,6 +132,10 @@ outputs:
127
132
description : Whether to run js client or not
128
133
value : ${{ steps.js-matrix.outputs.RUN_CLIENT }}
129
134
135
+ RUN_JS_COMMON :
136
+ description : Whether to build JS client common folders when RUN_JS is false
137
+ value : ${{ steps.js-matrix.outputs.RUN_COMMON }}
138
+
130
139
JS_MATRIX :
131
140
description : Generate the matrix for the Javascript client
132
141
value : ${{ steps.js-matrix.outputs.MATRIX }}
Original file line number Diff line number Diff line change 32
32
SPECS_MATRIX : ${{ steps.setup.outputs.SPECS_MATRIX }}
33
33
34
34
RUN_JS : ${{ steps.setup.outputs.RUN_JS }}
35
+ RUN_JS_COMMON : ${{ steps.setup.outputs.RUN_JS_COMMON }}
35
36
JS_MATRIX : ${{ steps.setup.outputs.JS_MATRIX }}
36
37
37
38
RUN_JAVA : ${{ steps.setup.outputs.RUN_JAVA }}
98
99
if : steps.cache.outputs.cache-hit != 'true'
99
100
run : yarn build:clients javascript ${{ matrix.client.name }}
100
101
102
+ client_javascript_common :
103
+ timeout-minutes : 10
104
+ runs-on : ubuntu-20.04
105
+ needs :
106
+ - setup
107
+ - specs
108
+ if : ${{ always() && needs.setup.outputs.RUN_JS_COMMON == 'true' }}
109
+ strategy :
110
+ matrix :
111
+ client :
112
+ - client-common
113
+ - requester-browser-xhr
114
+ - requester-node-http
115
+ steps :
116
+ - uses : actions/checkout@v2
117
+
118
+ - name : Restore cache
119
+ uses : ./.github/actions/cache
120
+ with :
121
+ job : client
122
+ spec : ${{ matrix.client }}
123
+
124
+ - name : Cache ${{ matrix.client }} client
125
+ id : cache
126
+ uses : actions/cache@v2
127
+ with :
128
+ path : ' /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-javascript/packages/${{ matrix.client }}/dist'
129
+ key : ${{ runner.os }}-1-js-${{ matrix.client }}-${{ hashFiles(format('clients/algoliasearch-client-javascript/packages/{0}/**', matrix.client)) }}
130
+
131
+ - name : Build ${{ matrix.client }} client
132
+ if : steps.cache.outputs.cache-hit != 'true'
133
+ run : yarn workspace @algolia/${{ matrix.client }} build
134
+
101
135
client_java :
102
136
runs-on : ubuntu-20.04
103
137
timeout-minutes : 10
@@ -172,6 +206,7 @@ jobs:
172
206
timeout-minutes : 20
173
207
needs :
174
208
- client_javascript
209
+ - client_javascript_common
175
210
- client_java
176
211
- client_php
177
212
Original file line number Diff line number Diff line change 20
20
# Commands are based on the LANGUAGE
21
21
if [[ $LANGUAGE == ' javascript' ]]; then
22
22
echo " > Cleaning previous build $GENERATOR ..."
23
-
24
23
yarn workspace $PACKAGE clean
25
24
26
25
echo " > Bundling $GENERATOR ..."
27
-
28
26
CMD=" yarn workspace $PACKAGE build"
29
27
elif [[ $LANGUAGE == ' php' ]]; then
30
28
# no build needed (for now)
Original file line number Diff line number Diff line change 6
6
LANGUAGE=$1
7
7
8
8
if [[ $CI ]]; then
9
+ echo " Not running post-gen/global on CI for $LANGUAGE "
10
+
9
11
exit 0
10
12
fi
11
13
You can’t perform that action at this time.
0 commit comments