@@ -30,63 +30,78 @@ jobs:
30
30
runs-on : ubuntu-latest
31
31
# Map a step output to a job output, this allows other jobs to be gated on the filter results
32
32
outputs :
33
- extra_push : ${{ steps.filter.outputs.extra_push }}
34
- extra_pull_request : ${{ steps.filter.outputs.extra_pull_request }}
35
- stackhpc : ${{ steps.filter.outputs.stackhpc }}
36
- trivvyscan : ${{ steps.filter.outputs.trivvyscan }}
33
+ extra_on_push : ${{ steps.filter_some.outputs.extra_on_push }}
34
+ extra_on_pull_request : ${{ steps.filter_some.outputs.extra_on_pull_request }}
35
+ stackhpc_some : ${{ steps.filter_some.outputs.stackhpc }}
36
+ stackhpc_every : ${{ steps.filter_every.outputs.stackhpc }}
37
+ trivvyscan : ${{ steps.filter_some.outputs.trivvyscan }}
37
38
steps :
38
39
- name : Checkout
39
40
uses : actions/checkout@v4
40
41
41
- - name : Paths Filter
42
+ - name : Paths matching on any filter
42
43
# For safety using commit of dorny/paths-filter@v3
43
44
uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
44
- id : filter
45
+ id : filter_some
45
46
with :
47
+ predicate-quantifier : ' some'
46
48
list-files : ' json'
47
49
filters : |
48
- extra_push :
50
+ extra_on_push :
49
51
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
50
52
- 'ansible/roles/doca/**'
51
53
- 'ansible/roles/cuda/**'
52
54
- 'ansible/roles/slurm_recompile/**' # runs on cuda group
53
55
- 'ansible/roles/lustre/**'
54
56
- '.github/workflows/extra.yml'
55
- extra_pull_request :
57
+ extra_on_pull_request :
56
58
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
57
59
- 'ansible/roles/doca/**'
58
60
- 'ansible/roles/cuda/**'
59
61
- 'ansible/roles/lustre/**'
60
62
- '.github/workflows/extra.yml'
63
+ stackhpc:
64
+ #- '**'
65
+ #- '!dev/**'
66
+ - 'dev/setup-env.sh'
67
+ #- '!docs/**'
68
+ #- '!README.md'
69
+ #- '!.gitignore'
70
+ #- '!.github/workflows/'
71
+ - '.github/workflows/stackhpc'
72
+ trivvyscan:
73
+ - 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
74
+
75
+ - name : Paths matching on every filter
76
+ # For safety using commit of dorny/paths-filter@v3
77
+ uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
78
+ id : filter_every
79
+ with :
80
+ predicate-quantifier : ' every'
81
+ list-files : ' json'
82
+ filters : |
61
83
stackhpc:
62
84
- '**'
63
85
- '!dev/**'
64
- - 'dev/setup-env.sh'
65
86
- '!docs/**'
66
87
- '!README.md'
67
88
- '!.gitignore'
68
89
- '!.github/workflows/'
69
- - '.github/workflows/stackhpc'
70
- trivvyscan:
71
- - 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
72
90
73
91
- name : Paths Filter Result
74
92
run : >
75
- echo '{ "extra_push_files": ${{ steps.filter.outputs.extra_push_files }} }' | jq -r '.';
76
- echo '{ "extra_pull_request_files": ${{ steps.filter.outputs.extra_pull_request_files }} }' | jq -r '.';
77
- echo '{ "stackhpc_files": ${{ steps.filter.outputs.stackhpc_files }} }' | jq -r '.';
78
- echo '{ "trivvyscan_files": ${{ steps.filter.outputs.trivvyscan_files }} }' | jq -r '.'
93
+ echo '{ "extra_on_push_files": ${{ steps.filter_some.outputs.extra_on_push_files }} }' | jq -r '.';
94
+ echo '{ "extra_on_pull_request_files": ${{ steps.filter_some.outputs.extra_on_pull_request_files }} }' | jq -r '.';
95
+ echo '{ "stackhpc_some_files": ${{ steps.filter_some.outputs.stackhpc_some_files }} }' | jq -r '.';
96
+ echo '{ "stackhpc_every_files": ${{ steps.filter_every.outputs.stackhpc_every_files }} }' | jq -r '.';
97
+ echo '{ "trivvyscan_files": ${{ steps.filter_some.outputs.trivvyscan_files }} }' | jq -r '.'
79
98
80
99
extra :
81
100
name : Test extra build
82
101
needs : files_changed
83
- # if: |
84
- # needs.files_changed.outputs.should_skip != 'true' &&
85
- # (( github.event_name != 'pull_request' && !fromJSON(needs.files_changed.outputs.paths_result).extra_push.should_skip ) ||
86
- # ( github.event_name == 'pull_request' && !fromJSON(needs.files_changed.outputs.paths_result).extra_pull_request.should_skip ))
87
102
if : |
88
- github.event_name != 'pull_request' && needs.files_changed.outputs.extra_push == 'true' ||
89
- github.event_name == 'pull_request' && needs.files_changed.outputs.extra_pull_request == 'true'
103
+ github.event_name != 'pull_request' && needs.files_changed.outputs.extra_on_push == 'true' ||
104
+ github.event_name == 'pull_request' && needs.files_changed.outputs.extra_on_pull_request == 'true'
90
105
# uses: ./.github/workflows/extra.yml
91
106
steps : # TEST
92
107
- name : Test extra build...
@@ -99,10 +114,9 @@ jobs:
99
114
stackhpc :
100
115
name : Test deployment and reimage on OpenStack
101
116
needs : files_changed
102
- # if: |
103
- # needs.files_changed.outputs.should_skip != 'true' && !fromJSON(needs.files_changed.outputs.paths_result).stackhpc.should_skip
104
117
if : |
105
- needs.files_changed.outputs.stackhpc == 'true'
118
+ needs.files_changed.outputs.stackhpc_some == 'true' ||
119
+ needs.files_changed.outputs.stackhpc_every == 'true'
106
120
# uses: ./.github/workflows/stackhpc.yml
107
121
steps : # TEST
108
122
- name : Test deployment and reimage on OpenStack...
@@ -115,9 +129,6 @@ jobs:
115
129
trivvyscan :
116
130
name : Trivy scan image for vulnerabilities
117
131
needs : files_changed
118
- # if: |
119
- # github.event_name == 'pull_request' &&
120
- # needs.files_changed.outputs.should_skip != 'true' && !fromJSON(needs.files_changed.outputs.paths_result).trivvyscan.should_skip
121
132
if : |
122
133
github.event_name == 'pull_request' &&
123
134
needs.files_changed.outputs.trivvyscan == 'true'
0 commit comments