Skip to content

Commit a3086ad

Browse files
committed
Add comments to workflow files detailing the CI workflow and enable these workflows
1 parent 8eed9d9 commit a3086ad

File tree

4 files changed

+45
-40
lines changed

4 files changed

+45
-40
lines changed

.github/workflows/extra.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
3+
# Test building extra images on OpenStack.
4+
# This workflow can run standalone or as part of the main CI workflow.
5+
# See the workflow file 'main.yml' for how this is CI triggered.
6+
27
name: Test extra build
38
on:
49
workflow_dispatch:

.github/workflows/main.yml

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
---
2+
3+
# This file governs the main CI workflow.
4+
# It's the only workflow triggered on push and pull requests,
5+
# it manages the CI workflow as follows:
6+
# 1. Lint the code aborting the workflow if there are linting errors.
7+
# 2. Determine which files have changed and set job outputs accordingly.
8+
# 3. Conditionally run the other workflows based on the changed files:
9+
# * stackhpc.yml
10+
# * extra.yml
11+
# * trivyscan.yml
12+
213
name: Test on push and pull request
314

415
permissions:
@@ -30,10 +41,10 @@ jobs:
3041
runs-on: ubuntu-latest
3142
# Map a step output to a job output, this allows other jobs to be gated on the filter results
3243
outputs:
33-
extra_on_push: ${{ steps.filter_on_some.outputs.extra_on_push }}
34-
extra_on_pull_request: ${{ steps.filter_on_some.outputs.extra_on_pull_request }}
3544
# The 'stackhpc' output will be 'true' if either of the two stackhpc filters below matched
3645
stackhpc: ${{ toJson(fromJson(steps.filter_on_every.outputs.stackhpc) || fromJson(steps.filter_on_some.outputs.stackhpc)) }}
46+
extra_on_push: ${{ steps.filter_on_some.outputs.extra_on_push }}
47+
extra_on_pull_request: ${{ steps.filter_on_some.outputs.extra_on_pull_request }}
3748
trivvyscan: ${{ steps.filter_on_some.outputs.trivvyscan }}
3849
steps:
3950
- name: Checkout
@@ -82,6 +93,9 @@ jobs:
8293
predicate-quantifier: 'some'
8394
list-files: 'json'
8495
filters: |
96+
stackhpc:
97+
- 'dev/setup-env.sh'
98+
- '.github/workflows/stackhpc.yml'
8599
extra_on_push:
86100
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
87101
- 'ansible/roles/doca/**'
@@ -95,65 +109,41 @@ jobs:
95109
- 'ansible/roles/cuda/**'
96110
- 'ansible/roles/lustre/**'
97111
- '.github/workflows/extra.yml'
98-
stackhpc:
99-
- 'dev/setup-env.sh'
100-
- '.github/workflows/stackhpc.yml'
101112
trivvyscan:
102113
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
103114
104115
- name: Paths matched output
105116
# NOTE: This is a debug step, it shows what files were matched by the filters.
106117
# It's useful because dorny/paths-filter doesn't work like the conventional 'paths' and 'paths_exclude'
107118
run: >
108-
echo '{ "extra_on_push_files": ${{ steps.filter_on_some.outputs.extra_on_push_files }} }' | jq -r '.';
109-
echo '{ "extra_on_pull_request_files": ${{ steps.filter_on_some.outputs.extra_on_pull_request_files }} }' | jq -r '.';
110119
echo '{ "stackhpc_every_files": ${{ steps.filter_on_every.outputs.stackhpc_files }} }' | jq -r '.';
111120
echo '{ "stackhpc_some_files": ${{ steps.filter_on_some.outputs.stackhpc_files }} }' | jq -r '.';
121+
echo '{ "extra_on_push_files": ${{ steps.filter_on_some.outputs.extra_on_push_files }} }' | jq -r '.';
122+
echo '{ "extra_on_pull_request_files": ${{ steps.filter_on_some.outputs.extra_on_pull_request_files }} }' | jq -r '.';
112123
echo '{ "trivvyscan_files": ${{ steps.filter_on_some.outputs.trivvyscan_files }} }' | jq -r '.'
113124
125+
stackhpc:
126+
name: Test deployment and reimage on OpenStack
127+
needs: files_changed
128+
if: |
129+
needs.files_changed.outputs.stackhpc == 'true'
130+
uses: ./.github/workflows/stackhpc.yml
131+
secrets: inherit
132+
114133
extra:
115134
name: Test extra build
116135
needs: files_changed
117136
if: |
118137
github.event_name != 'pull_request' && needs.files_changed.outputs.extra_on_push == 'true' ||
119138
github.event_name == 'pull_request' && needs.files_changed.outputs.extra_on_pull_request == 'true'
120-
#uses: ./.github/workflows/extra.yml
121-
#secrets: inherit
122-
# TEST - remove from here and uncomment the above two lines
123-
steps:
124-
- name: Test extra build...
125-
uses: jakejarvis/wait-action@master
126-
with:
127-
time: '120s'
128-
runs-on: ubuntu-latest
129-
130-
stackhpc:
131-
name: Test deployment and reimage on OpenStack
132-
needs: files_changed
133-
if: |
134-
needs.files_changed.outputs.stackhpc == 'true'
135-
#uses: ./.github/workflows/stackhpc.yml
136-
#secrets: inherit
137-
# TEST - remove from here and uncomment the above two lines
138-
steps:
139-
- name: Test deployment and reimage on OpenStack...
140-
uses: jakejarvis/wait-action@master
141-
with:
142-
time: '120s'
143-
runs-on: ubuntu-latest
139+
uses: ./.github/workflows/extra.yml
140+
secrets: inherit
144141

145142
trivvyscan:
146143
name: Trivy scan image for vulnerabilities
147144
needs: files_changed
148145
if: |
149146
github.event_name == 'pull_request' &&
150147
needs.files_changed.outputs.trivvyscan == 'true'
151-
#uses: ./.github/workflows/trivvyscan.yml
152-
#secrets: inherit
153-
# TEST - remove from here and uncomment the above two lines
154-
steps:
155-
- name: Trivy scan image for vulnerabilities...
156-
uses: jakejarvis/wait-action@master
157-
with:
158-
time: '120s'
159-
runs-on: ubuntu-latest
148+
uses: ./.github/workflows/trivvyscan.yml
149+
secrets: inherit

.github/workflows/stackhpc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
3+
# Test deployment and reimage on OpenStack.
4+
# This workflow can run standalone or as part of the main CI workflow.
5+
# See the workflow file 'main.yml' for how this is CI triggered.
6+
27
name: Test deployment and reimage on OpenStack
38
on:
49
workflow_dispatch:

.github/workflows/trivyscan.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
3+
# Scan the built image for vulnerabilities using Trivy.
4+
# This workflow can run standalone or as part of the main CI workflow.
5+
# See the workflow file 'main.yml' for how this is CI triggered.
6+
27
name: Trivy scan image for vulnerabilities
38
on:
49
workflow_dispatch:

0 commit comments

Comments
 (0)