Skip to content

Commit bb387d7

Browse files
committed
dont fail rhel 9/10 on 8 failing, or gcc/zig, each individually, step 2
1 parent 0e4e585 commit bb387d7

2 files changed

Lines changed: 158 additions & 26 deletions

File tree

.github/workflows/build-deb-forgejo.yml

Lines changed: 80 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,39 @@ jobs:
113113
echo "RPM_ARCH=x86_64" >> $GITHUB_ENV
114114
fi
115115
116+
- name: Download artifact from spc-download.yml
117+
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
118+
with:
119+
workflow: spc-download.yml
120+
name: downloads-tarball
121+
branch: master
122+
123+
- name: Compute buildroot cache key
124+
id: cache-key
125+
run: |
126+
set -euo pipefail
127+
HASH=$(
128+
{
129+
sha256sum composer.lock craft.yml bin/spp Dockerfile.debian downloads.tar.gz
130+
find src -type f -print0 | LC_ALL=C sort -z | xargs -0 sha256sum
131+
} | sha256sum | cut -c1-16
132+
)
133+
WEEK=$(date -u +%G-%V)
134+
echo "key=buildroot-deb-${{ matrix.arch }}-gcc-${WEEK}-${HASH}" >> $GITHUB_OUTPUT
135+
136+
- name: Restore buildroot cache
137+
id: cache
138+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
139+
with:
140+
path: buildroot.tar.zst
141+
key: ${{ steps.cache-key.outputs.key }}
142+
116143
- name: Prepare cache directories
144+
if: steps.cache.outputs.cache-hit != 'true'
117145
run: composer config -g cache-dir
118146

119147
- name: Cache Composer downloads
148+
if: steps.cache.outputs.cache-hit != 'true'
120149
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
121150
with:
122151
path: ~/.cache/composer
@@ -125,27 +154,31 @@ jobs:
125154
composer-
126155
127156
- name: Install vendor
157+
if: steps.cache.outputs.cache-hit != 'true'
128158
run: composer install --no-interaction --prefer-dist --no-progress
129159

130-
- name: Download artifact from spc-download.yml
131-
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
132-
with:
133-
workflow: spc-download.yml
134-
name: downloads-tarball
135-
branch: master
136-
137160
- name: Extract with permissions
161+
if: steps.cache.outputs.cache-hit != 'true'
138162
run: |
139163
mkdir -p downloads
140164
tar -xzf downloads.tar.gz -C downloads
141165
rm downloads.tar.gz
142166
143167
- name: Build libs
168+
if: steps.cache.outputs.cache-hit != 'true'
144169
run: bin/spp build --phpv=8.4 --type=deb --libs-only
145170

146171
- name: Pack buildroot
172+
if: steps.cache.outputs.cache-hit != 'true'
147173
run: tar --zstd -cf buildroot.tar.zst buildroot
148174

175+
- name: Save buildroot cache
176+
if: steps.cache.outputs.cache-hit != 'true'
177+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
178+
with:
179+
path: buildroot.tar.zst
180+
key: ${{ steps.cache-key.outputs.key }}
181+
149182
- name: Upload buildroot
150183
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
151184
with:
@@ -194,10 +227,39 @@ jobs:
194227
echo "RPM_ARCH=x86_64" >> $GITHUB_ENV
195228
fi
196229
230+
- name: Download artifact from spc-download.yml
231+
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
232+
with:
233+
workflow: spc-download.yml
234+
name: downloads-tarball
235+
branch: master
236+
237+
- name: Compute buildroot cache key
238+
id: cache-key
239+
run: |
240+
set -euo pipefail
241+
HASH=$(
242+
{
243+
sha256sum composer.lock craft.yml bin/spp Dockerfile.debian downloads.tar.gz
244+
find src -type f -print0 | LC_ALL=C sort -z | xargs -0 sha256sum
245+
} | sha256sum | cut -c1-16
246+
)
247+
WEEK=$(date -u +%G-%V)
248+
echo "key=buildroot-deb-${{ matrix.arch }}-zig-${WEEK}-${HASH}" >> $GITHUB_OUTPUT
249+
250+
- name: Restore buildroot cache
251+
id: cache
252+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
253+
with:
254+
path: buildroot.tar.zst
255+
key: ${{ steps.cache-key.outputs.key }}
256+
197257
- name: Prepare cache directories
258+
if: steps.cache.outputs.cache-hit != 'true'
198259
run: composer config -g cache-dir
199260

200261
- name: Cache Composer downloads
262+
if: steps.cache.outputs.cache-hit != 'true'
201263
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
202264
with:
203265
path: ~/.cache/composer
@@ -206,27 +268,31 @@ jobs:
206268
composer-
207269
208270
- name: Install vendor
271+
if: steps.cache.outputs.cache-hit != 'true'
209272
run: composer install --no-interaction --prefer-dist --no-progress
210273

211-
- name: Download artifact from spc-download.yml
212-
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
213-
with:
214-
workflow: spc-download.yml
215-
name: downloads-tarball
216-
branch: master
217-
218274
- name: Extract with permissions
275+
if: steps.cache.outputs.cache-hit != 'true'
219276
run: |
220277
mkdir -p downloads
221278
tar -xzf downloads.tar.gz -C downloads
222279
rm downloads.tar.gz
223280
224281
- name: Build libs
282+
if: steps.cache.outputs.cache-hit != 'true'
225283
run: bin/spp build --phpv=8.5 --type=deb --libs-only
226284

227285
- name: Pack buildroot
286+
if: steps.cache.outputs.cache-hit != 'true'
228287
run: tar --zstd -cf buildroot.tar.zst buildroot
229288

289+
- name: Save buildroot cache
290+
if: steps.cache.outputs.cache-hit != 'true'
291+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
292+
with:
293+
path: buildroot.tar.zst
294+
key: ${{ steps.cache-key.outputs.key }}
295+
230296
- name: Upload buildroot
231297
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
232298
with:

.github/workflows/build-rpm-modular-packages.yml

Lines changed: 78 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,38 @@ jobs:
129129
env:
130130
MATRIX_ARCH: ${{ matrix.arch }}
131131

132+
- name: Download artifact from spc-download.yml
133+
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
134+
with:
135+
workflow: spc-download.yml
136+
name: downloads-tarball
137+
138+
- name: Compute buildroot cache key
139+
id: cache-key
140+
run: |
141+
set -euo pipefail
142+
HASH=$(
143+
{
144+
sha256sum composer.lock craft.yml bin/spp Dockerfile.rhel downloads.tar.gz
145+
find src -type f -print0 | LC_ALL=C sort -z | xargs -0 sha256sum
146+
} | sha256sum | cut -c1-16
147+
)
148+
WEEK=$(date -u +%G-%V)
149+
echo "key=buildroot-rpm-alma${{ matrix.alma }}-${{ matrix.arch }}-gcc-${WEEK}-${HASH}" >> $GITHUB_OUTPUT
150+
151+
- name: Restore buildroot cache
152+
id: cache
153+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
154+
with:
155+
path: buildroot.tar.zst
156+
key: ${{ steps.cache-key.outputs.key }}
157+
132158
- name: Prepare cache directories
159+
if: steps.cache.outputs.cache-hit != 'true'
133160
run: composer config -g cache-dir
134161

135162
- name: Cache Composer downloads
163+
if: steps.cache.outputs.cache-hit != 'true'
136164
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
137165
with:
138166
path: ~/.cache/composer
@@ -141,26 +169,31 @@ jobs:
141169
composer-
142170
143171
- name: Composer install
172+
if: steps.cache.outputs.cache-hit != 'true'
144173
run: composer install --no-interaction --prefer-dist --no-progress
145174

146-
- name: Download artifact from spc-download.yml
147-
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
148-
with:
149-
workflow: spc-download.yml
150-
name: downloads-tarball
151-
152175
- name: Extract with permissions
176+
if: steps.cache.outputs.cache-hit != 'true'
153177
run: |
154178
mkdir -p downloads
155179
tar -xzf downloads.tar.gz -C downloads
156180
rm downloads.tar.gz
157181
158182
- name: Build libs
183+
if: steps.cache.outputs.cache-hit != 'true'
159184
run: php bin/spp build --type=rpm --debuginfo --phpv=8.4 --libs-only
160185

161186
- name: Pack buildroot
187+
if: steps.cache.outputs.cache-hit != 'true'
162188
run: tar -cf - buildroot | zstd -o buildroot.tar.zst
163189

190+
- name: Save buildroot cache
191+
if: steps.cache.outputs.cache-hit != 'true'
192+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
193+
with:
194+
path: buildroot.tar.zst
195+
key: ${{ steps.cache-key.outputs.key }}
196+
164197
- name: Upload buildroot
165198
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
166199
with:
@@ -211,10 +244,38 @@ jobs:
211244
env:
212245
MATRIX_ARCH: ${{ matrix.arch }}
213246

247+
- name: Download artifact from spc-download.yml
248+
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
249+
with:
250+
workflow: spc-download.yml
251+
name: downloads-tarball
252+
253+
- name: Compute buildroot cache key
254+
id: cache-key
255+
run: |
256+
set -euo pipefail
257+
HASH=$(
258+
{
259+
sha256sum composer.lock craft.yml bin/spp Dockerfile.rhel downloads.tar.gz
260+
find src -type f -print0 | LC_ALL=C sort -z | xargs -0 sha256sum
261+
} | sha256sum | cut -c1-16
262+
)
263+
WEEK=$(date -u +%G-%V)
264+
echo "key=buildroot-rpm-alma${{ matrix.alma }}-${{ matrix.arch }}-zig-${WEEK}-${HASH}" >> $GITHUB_OUTPUT
265+
266+
- name: Restore buildroot cache
267+
id: cache
268+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
269+
with:
270+
path: buildroot.tar.zst
271+
key: ${{ steps.cache-key.outputs.key }}
272+
214273
- name: Prepare cache directories
274+
if: steps.cache.outputs.cache-hit != 'true'
215275
run: composer config -g cache-dir
216276

217277
- name: Cache Composer downloads
278+
if: steps.cache.outputs.cache-hit != 'true'
218279
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
219280
with:
220281
path: ~/.cache/composer
@@ -223,26 +284,31 @@ jobs:
223284
composer-
224285
225286
- name: Composer install
287+
if: steps.cache.outputs.cache-hit != 'true'
226288
run: composer install --no-interaction --prefer-dist --no-progress
227289

228-
- name: Download artifact from spc-download.yml
229-
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
230-
with:
231-
workflow: spc-download.yml
232-
name: downloads-tarball
233-
234290
- name: Extract with permissions
291+
if: steps.cache.outputs.cache-hit != 'true'
235292
run: |
236293
mkdir -p downloads
237294
tar -xzf downloads.tar.gz -C downloads
238295
rm downloads.tar.gz
239296
240297
- name: Build libs
298+
if: steps.cache.outputs.cache-hit != 'true'
241299
run: php bin/spp build --type=rpm --debuginfo --phpv=8.5 --libs-only
242300

243301
- name: Pack buildroot
302+
if: steps.cache.outputs.cache-hit != 'true'
244303
run: tar -cf - buildroot | zstd -o buildroot.tar.zst
245304

305+
- name: Save buildroot cache
306+
if: steps.cache.outputs.cache-hit != 'true'
307+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
308+
with:
309+
path: buildroot.tar.zst
310+
key: ${{ steps.cache-key.outputs.key }}
311+
246312
- name: Upload buildroot
247313
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
248314
with:

0 commit comments

Comments
 (0)