@@ -14,64 +14,109 @@ jobs:
1414 SHELLCHECK_OPTS : -e SC1090 -e SC1091
1515
1616 detect-changes :
17+ name : " Detect changes"
1718 runs-on : ubuntu-latest
18- outputs :
19- apps : ${{ steps.output.outputs.apps }}
20- steps :
21- - uses : dorny/paths-filter@v2
22- id : filter
23- with :
24- list-files : json
25- # BENCH-4080: Re-enable cirrocumulus test
26- filters : |
27- common: &common
28- - '.github/workflows/test-pr.yaml'
29- - '.github/actions/smoke-test/**'
30- - 'startupscript/**'
31- - 'test/**'
32- - 'features/src/workbench-tools/**'
33- jupyter-template:
34- - *common
35- - './src/jupyter-template/**'
19+ strategy :
20+ matrix :
21+ common_filters :
22+ -
23+ - ' .github/workflows/test-pr.yaml'
24+ - ' .github/actions/smoke-test/**'
25+ - ' startupscript/**'
26+ - ' test/**'
27+ config :
28+ # BENCH-4080: Re-enable cirrocumulus test
29+ - jupyter-template :
30+ user : jupyter
3631 jupyter :
37- - *common
38- - './src/jupyter/**'
32+ user : jovyan
3933 shiny :
40- - *common
41- - './src/shiny/**'
34+ user : shiny
4235 r-analysis :
43- - *common
44- - './src/r-analysis/**'
36+ user : rstudio
37+ workbench_tools : true
4538 vscode :
46- - *common
47- - './src/vscode/**'
39+ user : abc
40+ workbench_tools : true
41+ workbench-jupyter :
42+ template : custom-workbench-jupyter-template
43+ user : jupyter
44+ maximize_build_space : true
45+ workbench_tools : true
46+ options :
47+ containerImage : ' us-west2-docker.pkg.dev/shared-pub-buckets-94mvrf/workbench-artifacts/app-workbench-jupyter:ov-dev-stable'
4848 jupyter-aou :
49- - *common
50- - './src/jupyter-aou/**'
49+ user : jupyter
50+ maximize_build_space : true
51+ workbench_tools : true
5152 nemo_jupyter :
52- - *common
53- - './src/nemo_jupyter/**'
53+ user : jupyter
54+ maximize_build_space : true
55+ workbench_tools : true
5456 nemo_jupyter_aou :
55- - *common
56- - './src/nemo_jupyter_aou/**'
57+ user : jupyter
58+ maximize_build_space : true
59+ workbench_tools : true
60+ filters :
61+ - ' src/nemo_jupyter/**'
5762 workbench-jupyter-parabricks :
58- - *common
59- - './src/workbench-jupyter-parabricks/**'
63+ user : jupyter
64+ workbench_tools : true
6065 workbench-jupyter-parabricks-aou :
61- - *common
62- - './src/workbench-jupyter-parabricks-aou/**'
66+ user : jupyter
67+ workbench_tools : true
68+ filters :
69+ - ' src/workbench-jupyter-parabricks/**'
70+ outputs :
71+ apps : ${{ steps.output.outputs.apps }}
72+ steps :
73+ - name : Build filters
74+ id : build-filters
75+ run : |
76+ CONFIG='${{ toJson(matrix.config) }}'
77+ COMMON='${{ toJson(matrix.common_filters) }}'
78+
79+ echo "filters<<EOF" >> $GITHUB_OUTPUT
80+ jq -n \
81+ --argjson config "$CONFIG" \
82+ --argjson common "$COMMON" \
83+ '[$config
84+ | to_entries
85+ | .[]
86+ | .value as $v
87+ | .value = $common
88+ | .value += ["src/" + ($v.template // .key) + "/**"]
89+ | .value += if $v.workbench_tools then ["features/src/workbench-tools/**"] else [] end
90+ | .value += ($v.filters // [])
91+ ] | from_entries' | yq -P >> $GITHUB_OUTPUT
92+ echo "EOF" >> $GITHUB_OUTPUT
93+ - uses : dorny/paths-filter@v2
94+ id : filter
95+ with :
96+ list-files : json
97+ filters : ${{ steps.build-filters.outputs.filters }}
6398 - name : Output changed templates as JSON object
6499 id : output
65100 run : |
66- MAXIMIZE_BUILD_SPACE='["jupyter-aou", "nemo_jupyter", "nemo_jupyter_aou"]'
67101 CHANGED_TEMPLATES='${{ steps.filter.outputs.changes }}'
102+ CONFIG='${{ toJson(matrix.config) }}'
68103
69104 # output to github output
70105 echo "apps<<EOF" >> $GITHUB_OUTPUT
71106 jq -n \
72107 --argjson changed "$CHANGED_TEMPLATES" \
73- --argjson maximize "$MAXIMIZE_BUILD_SPACE" \
74- '[$changed[] as $t | select($t != "common") | { template: $t, maximize_build_space: $maximize | (index($t) != null) }]' >> $GITHUB_OUTPUT
108+ --argjson config "$CONFIG" \
109+ '[$changed[] as $t
110+ | $config[$t]
111+ | select(. != null)
112+ | {
113+ template: (.template // $t),
114+ user,
115+ maximize_build_space: (.maximize_build_space // false),
116+ workbench_tools: (.workbench_tools // false),
117+ options: (.options // {}),
118+ }
119+ ]' >> $GITHUB_OUTPUT
75120 echo "EOF" >> $GITHUB_OUTPUT
76121
77122
@@ -111,3 +156,6 @@ jobs:
111156 uses : ./.github/actions/smoke-test
112157 with :
113158 template : " ${{ matrix.app.template }}"
159+ user : " ${{ matrix.app.user }}"
160+ workbench_tools : " ${{ matrix.app.workbench_tools }}"
161+ options : " ${{ toJSON(matrix.app.options) }}"
0 commit comments