Skip to content

Commit c63ada0

Browse files
authored
Slightly overhaul CI workflows (#454)
* [ci-on-tags.yml] Overhaul and split into two jobs Trigger / Rationale: Trying to download three multi-GB, layered docker images in a single job may result in `docker: write /var/lib/docker/tmp/GetImageBlobXYZ: no space left on device.`, see https://github.com/sailfishos-patches/patchmanager/actions/runs/5871696093/job/15921691170#step:7:45 Hence splitting the "big" `CI on tags` workflow into two jobs and slightly enhancing both CI workflows. * [ci-on-pull_req.yml] Overhaul
1 parent 72b7f89 commit c63ada0

File tree

2 files changed

+82
-21
lines changed

2 files changed

+82
-21
lines changed

.github/workflows/ci-on-pull_req.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
1-
name: CI on Pull Request to master and patchmanager3 branches
1+
name: CI on PRs to master & patchmanager3 branches
22

33
on:
44
pull_request:
55
branches:
66
- master
77
- patchmanager3
8+
# Allows to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
env:
12+
# Do not wait up to the default of 10 minutes for network timeouts in a workflow which runs ca. 5 minutes
13+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
14+
15+
defaults:
16+
run:
17+
# Note thas 'bash' provides -o pipefail, in contrast to the default (i.e., unspecified, which also uses bash) or 'sh',
18+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
19+
shell: sh
20+
21+
# See, e.g.: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
22+
concurrency:
23+
group: ci-${{ github.ref_name }}
24+
cancel-in-progress: false # 'false' (default) allows for two concurrent runs, one executing and one freshly enqueued; 'true' for only one; no 'concurrency:' defined for multiple.
825

926
jobs:
1027
build:
1128
runs-on: ubuntu-22.04
1229
env:
13-
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
30+
ARCH: i486
31+
RELEASE: 3.4.0.24
1432
steps:
33+
1534
- name: Checkout
1635
uses: actions/checkout@v3
1736

@@ -28,9 +47,6 @@ jobs:
2847
# key: cache
2948

3049
- name: Build ${{ env.ARCH }} on ${{ env.RELEASE }}
31-
env:
32-
ARCH: i486
33-
RELEASE: 3.4.0.24
3450
run: |
3551
set -x
3652
mkdir -p output/$RELEASE/$ARCH
@@ -44,7 +60,7 @@ jobs:
4460
- name: Upload build results
4561
uses: actions/upload-artifact@v3
4662
with:
47-
name: RPM-build-results
63+
name: RPM-build-results-${{ env.RELEASE }}-${{ env.ARCH }}
4864
path: output/
4965

5066
# "Create release" does not fit here, because this workflow is triggered by Pull Requests,
@@ -61,3 +77,9 @@ jobs:
6177
# hub release create"$assets" -m "$tag_name" "$tag_name"
6278
# env:
6379
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
81+
# Just for fun, see https://feathericons.com/ and
82+
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding
83+
#branding: # "Invalid workflow file: Unexpected value 'branding'"; maybe action MUST be located in '/' or the name MUST be action.yml, see e.g., https://github.com/actions/cache/blob/main/action.yml#L37
84+
# icon: 'gift'
85+
# color: 'purple'

.github/workflows/ci-on-tags.yml

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,41 @@ name: CI on tags
33
on:
44
push:
55
tags:
6-
- '*'
6+
# '**' also matches the slash ('/'), in contrast to '*',
7+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
8+
- '**'
9+
# Allows to run this workflow manually from the Actions tab
10+
workflow_dispatch:
711

12+
# See, e.g.: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
813
env:
14+
# For the latest available docker image, see https://github.com/CODeRUS/docker-sailfishos-platform-sdk
915
LATEST: 4.5.0.16
16+
# Do not wait up to the default of 10 minutes for network timeouts in a workflow which runs at most 20 minutes
17+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
18+
19+
defaults:
20+
run:
21+
# Note thas 'bash' provides -o pipefail, in contrast to the default (i.e., unspecified, which also uses bash) or 'sh',
22+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
23+
shell: sh
24+
25+
concurrency:
26+
group: ci-${{ github.ref_name }}
27+
cancel-in-progress: false # 'false' (default) allows for two concurrent runs, one executing and one freshly enqueued; 'true' for only one; no 'concurrency:' defined for multiple.
1028

1129
jobs:
12-
build:
13-
runs-on: ubuntu-22.04
30+
# One job for the latest Docker images used and one for the oldest ones.
31+
# Trying to download three multi-GB, layered docker images in a single job may
32+
# result in "docker: write /var/lib/docker/tmp/GetImageBlobXYZ: no space left on device."
33+
34+
build-on-LATEST:
1435
env:
15-
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
36+
RELEASE: ${{ env.LATEST }}
37+
runs-on: ubuntu-22.04
1638
steps:
17-
- name: Checkout
39+
40+
- name: Checkout git repository
1841
uses: actions/checkout@v3
1942

2043
#- name: Prepare
@@ -31,8 +54,7 @@ jobs:
3154

3255
- name: Build ${{ env.ARCH }} on ${{ env.RELEASE }}
3356
env:
34-
ARCH: aarch64
35-
RELEASE: ${{ env.LATEST }}
57+
ARCH: i486
3658
run: |
3759
set -x
3860
mkdir -p output/$RELEASE/$ARCH
@@ -46,7 +68,6 @@ jobs:
4668
- name: Build ${{ env.ARCH }} on ${{ env.RELEASE }}
4769
env:
4870
ARCH: armv7hl
49-
RELEASE: ${{ env.LATEST }}
5071
run: |
5172
set -x
5273
mkdir -p output/$RELEASE/$ARCH
@@ -59,8 +80,7 @@ jobs:
5980
6081
- name: Build ${{ env.ARCH }} on ${{ env.RELEASE }}
6182
env:
62-
ARCH: i486
63-
RELEASE: ${{ env.LATEST }}
83+
ARCH: aarch64
6484
run: |
6585
set -x
6686
mkdir -p output/$RELEASE/$ARCH
@@ -71,10 +91,23 @@ jobs:
7191
mb2 -t SailfishOS-$1-$2 build -d
7292
sudo cp -r RPMS/. /share/output/$1/$2/' sh_mb2 $RELEASE $ARCH
7393
94+
- name: Upload build results
95+
uses: actions/upload-artifact@v3
96+
with:
97+
name: RPM-build-results-${{ env.RELEASE }}
98+
path: output/
99+
100+
build-on-OLDEST:
101+
runs-on: ubuntu-22.04
102+
steps:
103+
104+
- name: Checkout git repository
105+
uses: actions/checkout@v3
106+
74107
- name: Build ${{ env.ARCH }} on ${{ env.RELEASE }}
75108
env:
76-
ARCH: aarch64
77-
RELEASE: 4.0.1.45
109+
ARCH: i486
110+
RELEASE: 3.4.0.24
78111
run: |
79112
set -x
80113
mkdir -p output/$RELEASE/$ARCH
@@ -101,8 +134,8 @@ jobs:
101134
102135
- name: Build ${{ env.ARCH }} on ${{ env.RELEASE }}
103136
env:
104-
ARCH: i486
105-
RELEASE: 3.4.0.24
137+
ARCH: aarch64
138+
RELEASE: 4.0.1.45
106139
run: |
107140
set -x
108141
mkdir -p output/$RELEASE/$ARCH
@@ -116,7 +149,7 @@ jobs:
116149
- name: Upload build results
117150
uses: actions/upload-artifact@v3
118151
with:
119-
name: RPM-build-results
152+
name: RPM-build-results-OLDEST
120153
path: output/
121154

122155
# Due to building two releases for each architecture, they will clobber each other,
@@ -133,3 +166,9 @@ jobs:
133166
# hub release create"$assets" -m "$tag_name" "$tag_name"
134167
# env:
135168
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
169+
170+
# Just for fun, see https://feathericons.com/ and
171+
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding
172+
#branding: # "Invalid workflow file: Unexpected value 'branding'"; maybe action MUST be located in '/' or the name MUST be action.yml, see e.g., https://github.com/actions/cache/blob/main/action.yml#L37
173+
# icon: 'gift'
174+
# color: 'purple'

0 commit comments

Comments
 (0)