Skip to content

Commit 1c298e9

Browse files
committed
Update GH workflow so linting always runs befor any other jobs
1 parent 9939b23 commit 1c298e9

File tree

4 files changed

+99
-44
lines changed

4 files changed

+99
-44
lines changed

.github/workflows/extra.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
1+
---
12
name: Test extra build
23
on:
34
workflow_dispatch:
4-
push:
5-
branches:
6-
- main
7-
paths:
8-
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
9-
- 'ansible/roles/doca/**'
10-
- 'ansible/roles/cuda/**'
11-
- 'ansible/roles/lustre/**'
12-
- '.github/workflows/extra.yml'
13-
pull_request:
14-
paths:
15-
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
16-
- 'ansible/roles/doca/**'
17-
- 'ansible/roles/cuda/**'
18-
- 'ansible/roles/lustre/**'
19-
- '.github/workflows/extra.yml'
205

216
permissions:
227
contents: read

.github/workflows/main.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
name: Test on push and pull request
3+
4+
permissions:
5+
actions: write
6+
contents: read
7+
packages: write
8+
# To report GitHub Actions status checks
9+
statuses: write
10+
id-token: write
11+
12+
on:
13+
push:
14+
branches:
15+
- main
16+
pull_request:
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.build.image_name }} # to branch/PR + OS
20+
cancel-in-progress: true
21+
22+
jobs:
23+
lint:
24+
name: Lint
25+
uses: ./.github/workflows/lint.yml
26+
27+
files_changed:
28+
name: Determine files changed
29+
needs: lint
30+
# continue-on-error: true # Uncomment once integration is finished
31+
runs-on: ubuntu-latest
32+
# Map a step output to a job output
33+
outputs:
34+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
35+
paths_result: ${{ steps.skip_check.outputs.paths_result }}
36+
steps:
37+
- id: skip_check
38+
# For security we use the commit of fkirc/skip-duplicate-actions@v5
39+
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf
40+
with:
41+
cancel_others: true
42+
paths_filter: |
43+
extra:
44+
paths:
45+
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
46+
- 'ansible/roles/doca/**'
47+
- 'ansible/roles/cuda/**'
48+
- 'ansible/roles/lustre/**'
49+
- '.github/workflows/extra.yml'
50+
stackhpc:
51+
paths:
52+
- '**'
53+
- '!dev/**'
54+
- 'dev/setup-env.sh'
55+
- '!docs/**'
56+
- '!README.md'
57+
- '!.gitignore'
58+
- '!.github/workflows/'
59+
- '.github/workflows/stackhpc'
60+
trivvyscan:
61+
paths:
62+
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
63+
64+
extra:
65+
name: Test extra build
66+
needs: files_changed
67+
if: needs.files_changed.outputs.should_skip != 'true' &&
68+
!fromJSON(needs.files_changed.outputs.paths_result).extra.should_skip
69+
#uses: ./.github/workflows/extra.yml
70+
steps: # TEST
71+
- run: echo "Running: Test extra build..." && sleep 30 # TEST
72+
runs-on: ubuntu-latest # TEST
73+
#secrets: inherit
74+
75+
stackhpc:
76+
name: Test deployment and reimage on OpenStack
77+
needs: files_changed
78+
if: needs.files_changed.outputs.should_skip != 'true' &&
79+
!fromJSON(needs.files_changed.outputs.paths_result).stackhpc.should_skip
80+
#uses: ./.github/workflows/stackhpc.yml
81+
steps: # TEST
82+
- run: echo "Running: Test deployment and reimage on OpenStack..." && sleep 30 # TEST
83+
runs-on: ubuntu-latest # TEST
84+
#secrets: inherit
85+
86+
trivvyscan:
87+
name: Trivy scan image for vulnerabilities
88+
needs: files_changed
89+
if: github.event_name == 'pull_request' &&
90+
needs.files_changed.outputs.should_skip != 'true' &&
91+
!fromJSON(needs.files_changed.outputs.paths_result).trivvyscan.should_skip
92+
#uses: ./.github/workflows/trivvyscan.yml
93+
steps: # TEST
94+
- run: echo "Running: Trivy scan image for vulnerabilities..." && sleep 30 # TEST
95+
runs-on: ubuntu-latest # TEST
96+
#secrets: inherit

.github/workflows/stackhpc.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
1-
1+
---
22
name: Test deployment and reimage on OpenStack
33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
8-
paths:
9-
- '**'
10-
- '!dev/**'
11-
- 'dev/setup-env.sh'
12-
- '!docs/**'
13-
- '!README.md'
14-
- '!.gitignore'
15-
- '!.github/workflows/'
16-
- '.github/workflows/stackhpc'
17-
pull_request:
18-
paths:
19-
- '**'
20-
- '!dev/**'
21-
- 'dev/setup-env.sh'
22-
- '!docs/**'
23-
- '!README.md'
24-
- '!.gitignore'
25-
- '!.github/workflows/'
26-
- '.github/workflows/stackhpc'
275

286
permissions:
297
contents: read

.github/workflows/trivyscan.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1+
---
12
name: Trivy scan image for vulnerabilities
23
on:
34
workflow_dispatch:
4-
pull_request:
5-
branches:
6-
- main
7-
paths:
8-
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
95

106
permissions:
117
contents: read

0 commit comments

Comments
 (0)