Skip to content

Commit 688bd7b

Browse files
refactor(ci): use composite action to dedup singularity setup (#602)
fixes #603
1 parent 92cd472 commit 688bd7b

File tree

4 files changed

+58
-206
lines changed

4 files changed

+58
-206
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Singularity Setup
2+
description: All steps to use/build Singularity container
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Setup apptainer
7+
uses: eWaterCycle/setup-apptainer@v2.0.0
8+
- name: Get container from cache
9+
id: cache-sif
10+
uses: actions/cache@v4
11+
with:
12+
path: .singularity/image.sif
13+
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
14+
- name: Get gems and node files from cache
15+
id: cache-bundle-npm
16+
uses: actions/cache@v4
17+
with:
18+
path: |
19+
.home/.gems
20+
node_modules
21+
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
22+
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
23+
name: Build container
24+
run: ./bin/build_container
25+
shell: bash
26+
- name: Setup project
27+
run: ./bin/setup
28+
shell: bash

.github/workflows/nightly.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,7 @@ jobs:
3131
steps:
3232
- name: Clone Github Repo Action
3333
uses: actions/checkout@v4
34-
- name: Setup apptainer
35-
uses: eWaterCycle/setup-apptainer@v2.0.0
36-
- name: Get container from cache
37-
id: cache-sif
38-
uses: actions/cache@v4
39-
with:
40-
path: .singularity/image.sif
41-
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
42-
- name: Get gems and node files from cache
43-
id: cache-bundle-npm
44-
uses: actions/cache@v4
45-
with:
46-
path: |
47-
.home/.gems
48-
node_modules
49-
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
50-
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
51-
name: Build container
52-
run: ./bin/build_container
53-
- name: Setup project
54-
run: ./bin/setup
34+
- name: singularity setup
35+
uses: ./.github/actions/singularity-setup
5536
- name: Run regression
5637
run: ./do test:nightly

.github/workflows/pages.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,8 @@ jobs:
2222
steps:
2323
- name: Clone Github Repo Action
2424
uses: actions/checkout@v4
25-
- name: Setup apptainer
26-
uses: eWaterCycle/setup-apptainer@v2.0.0
27-
- name: Get container from cache
28-
id: cache-sif
29-
uses: actions/cache@v4
30-
with:
31-
path: .singularity/image.sif
32-
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
33-
- name: Get gems and node files from cache
34-
id: cache-bundle-npm
35-
uses: actions/cache@v4
36-
with:
37-
path: |
38-
.home/.gems
39-
node_modules
40-
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
41-
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
42-
name: Build container
43-
run: ./bin/build_container
44-
- name: Setup project
45-
run: ./bin/setup
25+
- name: singularity setup
26+
uses: ./.github/actions/singularity-setup
4627
- name: Create deploy dir
4728
run: /bin/bash lib/deploy.sh
4829
- name: Setup Pages

.github/workflows/regress.yml

Lines changed: 26 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on:
33
push:
44
branches:
55
- main
6-
merge_group: # this is a new line
7-
types: [checks_requested] # this is a new line
6+
merge_group:
7+
types: [checks_requested]
88
pull_request:
99
branches:
1010
- main
@@ -23,27 +23,8 @@ jobs:
2323
steps:
2424
- name: Clone Github Repo Action
2525
uses: actions/checkout@v4
26-
- name: Setup apptainer
27-
uses: eWaterCycle/setup-apptainer@v2.0.0
28-
- name: Get container from cache
29-
id: cache-sif
30-
uses: actions/cache@v4
31-
with:
32-
path: .singularity/image.sif
33-
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
34-
- name: Get gems and node files from cache
35-
id: cache-bundle-npm
36-
uses: actions/cache@v4
37-
with:
38-
path: |
39-
.home/.gems
40-
node_modules
41-
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
42-
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
43-
name: Build container
44-
run: ./bin/build_container
45-
- name: Setup project
46-
run: ./bin/setup
26+
- name: singularity setup
27+
uses: ./.github/actions/singularity-setup
4728
- name: Run smoke
4829
run: ./do test:smoke
4930
regress-gen-isa-manual:
@@ -55,81 +36,30 @@ jobs:
5536
steps:
5637
- name: Clone Github Repo Action
5738
uses: actions/checkout@v4
58-
- name: Setup apptainer
59-
uses: eWaterCycle/setup-apptainer@v2.0.0
60-
- name: Get container from cache
61-
id: cache-sif
62-
uses: actions/cache@v4
63-
with:
64-
path: .singularity/image.sif
65-
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
66-
- name: Get gems and node files from cache
67-
id: cache-bundle-npm
68-
uses: actions/cache@v4
69-
with:
70-
path: |
71-
.home/.gems
72-
node_modules
73-
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
74-
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
75-
name: Build container
76-
run: ./bin/build_container
39+
- name: singularity setup
40+
uses: ./.github/actions/singularity-setup
7741
- name: Generate HTML ISA manual
7842
run: ./do gen:html_manual
7943
regress-gen-instruction-appendix:
80-
runs-on: ubuntu-latest
81-
env:
82-
SINGULARITY: 1
83-
steps:
84-
- name: Clone Github Repo Action
85-
uses: actions/checkout@v4
86-
- name: Setup apptainer
87-
uses: eWaterCycle/setup-apptainer@v2.0.0
88-
- name: Get container from cache
89-
id: cache-sif
90-
uses: actions/cache@v4
91-
with:
92-
path: .singularity/image.sif
93-
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
94-
- name: Get gems and node files from cache
95-
id: cache-bundle-npm
96-
uses: actions/cache@v4
97-
with:
98-
path: |
99-
.home/.gems
100-
node_modules
101-
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
102-
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
103-
name: Build container
104-
run: ./bin/build_container
105-
- name: Generate instruction appendix
106-
run: ./do gen:instruction_appendix
44+
runs-on: ubuntu-latest
45+
env:
46+
SINGULARITY: 1
47+
steps:
48+
- name: Clone Github Repo Action
49+
uses: actions/checkout@v4
50+
- name: singularity setup
51+
uses: ./.github/actions/singularity-setup
52+
- name: Generate instruction appendix
53+
run: ./do gen:instruction_appendix
10754
regress-cfg-manual:
10855
runs-on: ubuntu-latest
10956
env:
11057
SINGULARITY: 1
11158
steps:
11259
- name: Clone Github Repo Action
11360
uses: actions/checkout@v4
114-
- name: Setup apptainer
115-
uses: eWaterCycle/setup-apptainer@v2.0.0
116-
- name: Get container from cache
117-
id: cache-sif
118-
uses: actions/cache@v4
119-
with:
120-
path: .singularity/image.sif
121-
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
122-
- name: Get gems and node files from cache
123-
id: cache-bundle-npm
124-
uses: actions/cache@v4
125-
with:
126-
path: |
127-
.home/.gems
128-
node_modules
129-
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
130-
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
131-
name: Build container
132-
run: ./bin/build_container
61+
- name: singularity setup
62+
uses: ./.github/actions/singularity-setup
13363
- name: Generate HTML ISA manual
13464
run: ./do gen:html[example_rv64_with_overlay]
13565
regress-gen-ext-pdf:
@@ -142,25 +72,8 @@ jobs:
14272
steps:
14373
- name: Clone Github Repo Action
14474
uses: actions/checkout@v4
145-
- name: Setup apptainer
146-
uses: eWaterCycle/setup-apptainer@v2.0.0
147-
- name: Get container from cache
148-
id: cache-sif
149-
uses: actions/cache@v4
150-
with:
151-
path: .singularity/image.sif
152-
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
153-
- name: Get gems and node files from cache
154-
id: cache-bundle-npm
155-
uses: actions/cache@v4
156-
with:
157-
path: |
158-
.home/.gems
159-
node_modules
160-
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
161-
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
162-
name: Build container
163-
run: ./bin/build_container
75+
- name: singularity setup
76+
uses: ./.github/actions/singularity-setup
16477
- name: Generate extension PDF
16578
run: ./do gen:ext_pdf
16679
regress-gen-certificate:
@@ -170,25 +83,8 @@ jobs:
17083
steps:
17184
- name: Clone Github Repo Action
17285
uses: actions/checkout@v4
173-
- name: Setup apptainer
174-
uses: eWaterCycle/setup-apptainer@v2.0.0
175-
- name: Get container from cache
176-
id: cache-sif
177-
uses: actions/cache@v4
178-
with:
179-
path: .singularity/image.sif
180-
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
181-
- name: Get gems and node files from cache
182-
id: cache-bundle-npm
183-
uses: actions/cache@v4
184-
with:
185-
path: |
186-
.home/.gems
187-
node_modules
188-
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
189-
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
190-
name: Build container
191-
run: ./bin/build_container
86+
- name: singularity setup
87+
uses: ./.github/actions/singularity-setup
19288
- name: Generate extension PDF
19389
run: ./do gen:cert_model_pdf[MockCertificateModel]
19490
regress-gen-profile:
@@ -198,25 +94,8 @@ jobs:
19894
steps:
19995
- name: Clone Github Repo Action
20096
uses: actions/checkout@v4
201-
- name: Setup apptainer
202-
uses: eWaterCycle/setup-apptainer@v2.0.0
203-
- name: Get container from cache
204-
id: cache-sif
205-
uses: actions/cache@v4
206-
with:
207-
path: .singularity/image.sif
208-
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
209-
- name: Get gems and node files from cache
210-
id: cache-bundle-npm
211-
uses: actions/cache@v4
212-
with:
213-
path: |
214-
.home/.gems
215-
node_modules
216-
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
217-
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
218-
name: Build container
219-
run: ./bin/build_container
97+
- name: singularity setup
98+
uses: ./.github/actions/singularity-setup
22099
- name: Generate extension PDF
221100
run: ./do gen:profile[MockProfileRelease]
222101
regress-gen-go:
@@ -226,24 +105,7 @@ jobs:
226105
steps:
227106
- name: Clone Github Repo Action
228107
uses: actions/checkout@v4
229-
- name: Setup apptainer
230-
uses: eWaterCycle/setup-apptainer@v2.0.0
231-
- name: Get container from cache
232-
id: cache-sif
233-
uses: actions/cache@v4
234-
with:
235-
path: .singularity/image.sif
236-
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
237-
- name: Get gems and node files from cache
238-
id: cache-bundle-npm
239-
uses: actions/cache@v4
240-
with:
241-
path: |
242-
.home/.gems
243-
node_modules
244-
key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }}
245-
- if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }}
246-
name: Build container
247-
run: ./bin/build_container
108+
- name: singularity setup
109+
uses: ./.github/actions/singularity-setup
248110
- name: Generate Go code
249111
run: ./do gen:go

0 commit comments

Comments
 (0)