@@ -33,18 +33,18 @@ jobs:
33
33
extra_on_push : ${{ steps.filter_some.outputs.extra_on_push }}
34
34
extra_on_pull_request : ${{ steps.filter_some.outputs.extra_on_pull_request }}
35
35
stackhpc : ${{ toJson(fromJson(steps.filter_some.outputs.stackhpc) || fromJson(steps.filter_every.outputs.stackhpc)) }}
36
- stackhpc_some : ${{ steps.filter_some.outputs.stackhpc }}
37
- stackhpc_every : ${{ steps.filter_every.outputs.stackhpc }}
38
36
trivvyscan : ${{ steps.filter_some.outputs.trivvyscan }}
39
37
steps :
40
38
- name : Checkout
41
39
uses : actions/checkout@v4
42
40
43
- - name : Paths matching on any filter
44
- # For safety using commit of dorny/paths-filter@v3
41
+ - name : Paths matching on any filter rule
42
+ # For safety use the commit of dorny/paths-filter@v3
45
43
uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
46
44
id : filter_some
47
45
with :
46
+ # Filter changed files, 'some' means the file is matched if any one of the filter rules match.
47
+ # Processing is different from 'paths' and 'paths_exclude', see note below.
48
48
predicate-quantifier : ' some'
49
49
list-files : ' json'
50
50
filters : |
@@ -62,54 +62,47 @@ jobs:
62
62
- 'ansible/roles/lustre/**'
63
63
- '.github/workflows/extra.yml'
64
64
stackhpc:
65
- #- '**'
66
- #- '!dev/**'
67
- - 'dev/setup-env.sh___TMP_WILL_NOT_MATCH'
68
- #- '!docs/**'
69
- #- '!README.md'
70
- #- '!.gitignore'
71
- #- '!.github/workflows/'
65
+ - 'dev/setup-env.sh'
72
66
- '.github/workflows/stackhpc'
73
67
trivvyscan:
74
68
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
75
69
76
- - name : Paths matching on every filter
77
- # For safety using commit of dorny/paths-filter@v3
70
+ - name : Paths matching on every filter rule
71
+ # For safety use the commit of dorny/paths-filter@v3
78
72
uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
79
73
id : filter_every
80
74
with :
75
+ # Filter changed files, 'every' means the file is matched only if matches all filter rules.
76
+ # Processing is different from 'paths' and 'paths_exclude', see note below.
81
77
predicate-quantifier : ' every'
82
78
list-files : ' json'
83
79
filters : |
84
80
stackhpc:
85
- - '**___TMP_WILL_NOT_MATCH '
81
+ - '**'
86
82
- '!dev/**'
87
83
- '!**/*.md'
88
84
- '!.gitignore'
89
85
- '!.github/workflows/'
90
86
91
- - name : Paths matching
87
+ - name : Paths matched output
88
+ # NOTE: This is a debug step, it prints the paths that matched the filters
89
+ # It's useful because dorny/paths-filter doesn't work like the conventional 'paths' and 'paths_exclude'
90
+ # We can't do the following:
91
+ # paths:
92
+ # - '**'
93
+ # - '!dev/**'
94
+ # - 'dev/setup-env.sh'
95
+ #
96
+ # Which would include all files whilst removing all "dev/" files except "dev/setup-env.sh".
97
+ # Instead the 'some' stackhpc filter ensures we include "dev/setup-env.sh" - if changed,
98
+ # the 'every' stackhpc filter ensures we don't include any other "dev/**" files.
92
99
run : >
93
100
echo '{ "extra_on_push_files": ${{ steps.filter_some.outputs.extra_on_push_files }} }' | jq -r '.';
94
101
echo '{ "extra_on_pull_request_files": ${{ steps.filter_some.outputs.extra_on_pull_request_files }} }' | jq -r '.';
95
102
echo '{ "stackhpc_some_files": ${{ steps.filter_some.outputs.stackhpc_files }} }' | jq -r '.';
96
103
echo '{ "stackhpc_every_files": ${{ steps.filter_every.outputs.stackhpc_files }} }' | jq -r '.';
97
104
echo '{ "trivvyscan_files": ${{ steps.filter_some.outputs.trivvyscan_files }} }' | jq -r '.'
98
105
99
- debug :
100
- name : Debug paths matching
101
- needs : files_changed
102
- steps :
103
- - name : Debug paths matching
104
- run : >
105
- echo 'extra_on_push: ${{ needs.files_changed.outputs.extra_on_push }}';
106
- echo 'extra_on_pull_request: ${{ needs.files_changed.outputs.extra_on_pull_request }}';
107
- echo 'stackhpc: ${{ needs.files_changed.outputs.stackhpc }}';
108
- echo 'stackhpc_some: ${{ needs.files_changed.outputs.stackhpc_some }}';
109
- echo 'stackhpc_every: ${{ needs.files_changed.outputs.stackhpc_every }}';
110
- echo 'trivvyscan: ${{ needs.files_changed.outputs.trivvyscan }}'
111
- runs-on : ubuntu-latest # TEST
112
-
113
106
extra :
114
107
name : Test extra build
115
108
needs : files_changed
@@ -129,8 +122,7 @@ jobs:
129
122
name : Test deployment and reimage on OpenStack
130
123
needs : files_changed
131
124
if : |
132
- needs.files_changed.outputs.stackhpc_some == 'true' ||
133
- needs.files_changed.outputs.stackhpc_every == 'true'
125
+ needs.files_changed.outputs.stackhpc == 'true'
134
126
# uses: ./.github/workflows/stackhpc.yml
135
127
steps : # TEST
136
128
- name : Test deployment and reimage on OpenStack...
0 commit comments