From 36edbb82768e0b5da45890d99ce65a3ec284614f Mon Sep 17 00:00:00 2001 From: olf Date: Wed, 16 Aug 2023 06:15:49 +0200 Subject: [PATCH 1/9] [ci-on-tags.yml] Overhaul and split into two jobs 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.` --- .github/workflows/ci-on-tags.yml | 67 +++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-on-tags.yml b/.github/workflows/ci-on-tags.yml index 095f34c1..24a74d2a 100644 --- a/.github/workflows/ci-on-tags.yml +++ b/.github/workflows/ci-on-tags.yml @@ -3,18 +3,39 @@ name: CI on tags on: push: tags: - - '*' + # '**' also matches the slash ('/'), in contrast to '*', see + - '**' + # Allows to run this workflow manually from the Actions tab + workflow_dispatch: env: + # For the latest available docker image, see https://github.com/CODeRUS/docker-sailfishos-platform-sdk LATEST: 4.5.0.16 + # Do not wait up to the default of 10 minutes for a workflow which runs at most 15 minutes + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 + +defaults: + run: + # Note thas 'bash' provides -o pipefail, in contrast to the default (i.e., unspecified, which also uses bash) or 'sh', + # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell + shell: sh + +concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true jobs: - build: - runs-on: ubuntu-22.04 + # One job for the latest Docker images used and one for the oldest ones. + # 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." + + build-on-LATEST: env: - SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 + RELEASE: ${{ env.LATEST }} + runs-on: ubuntu-22.04 steps: - - name: Checkout + + - name: Checkout git repository uses: actions/checkout@v3 #- name: Prepare @@ -31,8 +52,7 @@ jobs: - name: Build ${{ env.ARCH }} on ${{ env.RELEASE }} env: - ARCH: aarch64 - RELEASE: ${{ env.LATEST }} + ARCH: i486 run: | set -x mkdir -p output/$RELEASE/$ARCH @@ -46,7 +66,6 @@ jobs: - name: Build ${{ env.ARCH }} on ${{ env.RELEASE }} env: ARCH: armv7hl - RELEASE: ${{ env.LATEST }} run: | set -x mkdir -p output/$RELEASE/$ARCH @@ -59,8 +78,7 @@ jobs: - name: Build ${{ env.ARCH }} on ${{ env.RELEASE }} env: - ARCH: i486 - RELEASE: ${{ env.LATEST }} + ARCH: aarch64 run: | set -x mkdir -p output/$RELEASE/$ARCH @@ -71,10 +89,23 @@ jobs: mb2 -t SailfishOS-$1-$2 build -d sudo cp -r RPMS/. /share/output/$1/$2/' sh_mb2 $RELEASE $ARCH + - name: Upload build results + uses: actions/upload-artifact@v3 + with: + name: RPM-build-results-${{ env.RELEASE }} + path: output/ + + build-on-OLDEST: + runs-on: ubuntu-22.04 + steps: + + - name: Checkout git repository + uses: actions/checkout@v3 + - name: Build ${{ env.ARCH }} on ${{ env.RELEASE }} env: - ARCH: aarch64 - RELEASE: 4.0.1.45 + ARCH: i486 + RELEASE: 3.4.0.24 run: | set -x mkdir -p output/$RELEASE/$ARCH @@ -101,8 +132,8 @@ jobs: - name: Build ${{ env.ARCH }} on ${{ env.RELEASE }} env: - ARCH: i486 - RELEASE: 3.4.0.24 + ARCH: aarch64 + RELEASE: 4.0.1.45 run: | set -x mkdir -p output/$RELEASE/$ARCH @@ -116,7 +147,7 @@ jobs: - name: Upload build results uses: actions/upload-artifact@v3 with: - name: RPM-build-results + name: RPM-build-results-OLDEST path: output/ # Due to building two releases for each architecture, they will clobber each other, @@ -133,3 +164,9 @@ jobs: # hub release create"$assets" -m "$tag_name" "$tag_name" # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# Just for fun, see https://feathericons.com/ and +# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding +branding: + icon: 'gift' + color: 'purple' From 0ba12645ce6cf20a735bcd5d8b37dc9fea91bc0d Mon Sep 17 00:00:00 2001 From: olf Date: Wed, 16 Aug 2023 06:26:10 +0200 Subject: [PATCH 2/9] [ci-on-tags.yml] Enhance two comments --- .github/workflows/ci-on-tags.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-on-tags.yml b/.github/workflows/ci-on-tags.yml index 24a74d2a..6ee3fe59 100644 --- a/.github/workflows/ci-on-tags.yml +++ b/.github/workflows/ci-on-tags.yml @@ -3,7 +3,8 @@ name: CI on tags on: push: tags: - # '**' also matches the slash ('/'), in contrast to '*', see + # '**' also matches the slash ('/'), in contrast to '*', + # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - '**' # Allows to run this workflow manually from the Actions tab workflow_dispatch: @@ -11,7 +12,7 @@ on: env: # For the latest available docker image, see https://github.com/CODeRUS/docker-sailfishos-platform-sdk LATEST: 4.5.0.16 - # Do not wait up to the default of 10 minutes for a workflow which runs at most 15 minutes + # Do not wait up to the default of 10 minutes for network timeouts in a workflow which runs at most 15 minutes SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 defaults: From bf98b8be52c02dc341380e54d66e622798841692 Mon Sep 17 00:00:00 2001 From: olf Date: Wed, 16 Aug 2023 06:39:45 +0200 Subject: [PATCH 3/9] [ci-on-pull_req.yml] Overhaul slightly --- .github/workflows/ci-on-pull_req.yml | 34 +++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-on-pull_req.yml b/.github/workflows/ci-on-pull_req.yml index da3a5d99..fca382a9 100644 --- a/.github/workflows/ci-on-pull_req.yml +++ b/.github/workflows/ci-on-pull_req.yml @@ -1,17 +1,35 @@ -name: CI on Pull Request to master and patchmanager3 branches +name: CI on PRs to master & patchmanager3 branches on: pull_request: branches: - master - patchmanager3 + # Allows to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + # Do not wait up to the default of 10 minutes for network timeouts in a workflow which runs at most 3 minutes + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 + +defaults: + run: + # Note thas 'bash' provides -o pipefail, in contrast to the default (i.e., unspecified, which also uses bash) or 'sh', + # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell + shell: sh + +concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true jobs: build: runs-on: ubuntu-22.04 env: - SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 + ARCH: i486 + RELEASE: 3.4.0.24 steps: + - name: Checkout uses: actions/checkout@v3 @@ -28,9 +46,6 @@ jobs: # key: cache - name: Build ${{ env.ARCH }} on ${{ env.RELEASE }} - env: - ARCH: i486 - RELEASE: 3.4.0.24 run: | set -x mkdir -p output/$RELEASE/$ARCH @@ -44,7 +59,7 @@ jobs: - name: Upload build results uses: actions/upload-artifact@v3 with: - name: RPM-build-results + name: RPM-build-results-${{ env.RELEASE }}-${{ env.ARCH }} path: output/ # "Create release" does not fit here, because this workflow is triggered by Pull Requests, @@ -61,3 +76,10 @@ jobs: # hub release create"$assets" -m "$tag_name" "$tag_name" # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# Just for fun, see https://feathericons.com/ and +# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding +branding: + icon: 'gift' + color: 'purple' + From 7afa12c7789051b8a41fa358135f57adabb05bd0 Mon Sep 17 00:00:00 2001 From: olf Date: Wed, 16 Aug 2023 06:44:01 +0200 Subject: [PATCH 4/9] [ci-on-tags.yml] Add trailing newline --- .github/workflows/ci-on-tags.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-on-tags.yml b/.github/workflows/ci-on-tags.yml index 6ee3fe59..52ea5676 100644 --- a/.github/workflows/ci-on-tags.yml +++ b/.github/workflows/ci-on-tags.yml @@ -171,3 +171,4 @@ jobs: branding: icon: 'gift' color: 'purple' + From 49f49e49b0b435d419478f4ce6f50b68c92ccb67 Mon Sep 17 00:00:00 2001 From: olf Date: Wed, 16 Aug 2023 06:56:04 +0200 Subject: [PATCH 5/9] [ci-on-tags.yml] Omit branding for now --- .github/workflows/ci-on-tags.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-on-tags.yml b/.github/workflows/ci-on-tags.yml index 52ea5676..f35e8460 100644 --- a/.github/workflows/ci-on-tags.yml +++ b/.github/workflows/ci-on-tags.yml @@ -168,7 +168,6 @@ jobs: # Just for fun, see https://feathericons.com/ and # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding -branding: - icon: 'gift' - color: 'purple' - +# branding: # It does not like it, may be the name MUST be action.yml, see e.g., https://github.com/actions/cache/blob/main/action.yml#L37 +# icon: 'gift' +# color: 'purple' From 348d56512f916ac241f950aaac609c89c843c124 Mon Sep 17 00:00:00 2001 From: olf Date: Wed, 16 Aug 2023 06:59:22 +0200 Subject: [PATCH 6/9] [ci-on-pull_req.yml] Omit 'branding' for now --- .github/workflows/ci-on-pull_req.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-on-pull_req.yml b/.github/workflows/ci-on-pull_req.yml index fca382a9..f2df4f03 100644 --- a/.github/workflows/ci-on-pull_req.yml +++ b/.github/workflows/ci-on-pull_req.yml @@ -79,7 +79,6 @@ jobs: # Just for fun, see https://feathericons.com/ and # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding -branding: - icon: 'gift' - color: 'purple' - +#branding: # "Invalid workflow file: Unexpected value 'branding'"; maybe the name MUST be action.yml, see e.g., https://github.com/actions/cache/blob/main/action.yml#L37 +# icon: 'gift' +# color: 'purple' From a1b6d1367cbac60ae337fc117eb38df5b06a7182 Mon Sep 17 00:00:00 2001 From: olf Date: Wed, 16 Aug 2023 07:02:32 +0200 Subject: [PATCH 7/9] [ci-on-tags.yml] Enhance comment on `branding:` --- .github/workflows/ci-on-tags.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-on-tags.yml b/.github/workflows/ci-on-tags.yml index f35e8460..2190dd1a 100644 --- a/.github/workflows/ci-on-tags.yml +++ b/.github/workflows/ci-on-tags.yml @@ -168,6 +168,6 @@ jobs: # Just for fun, see https://feathericons.com/ and # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding -# branding: # It does not like it, may be the name MUST be action.yml, see e.g., https://github.com/actions/cache/blob/main/action.yml#L37 +#branding: # "Invalid workflow file: Unexpected value 'branding'"; maybe the name MUST be action.yml, see e.g., https://github.com/actions/cache/blob/main/action.yml#L37 # icon: 'gift' # color: 'purple' From b11ab5e975e9dbb6c38702ba809c91bcc5e12623 Mon Sep 17 00:00:00 2001 From: olf Date: Wed, 16 Aug 2023 07:43:19 +0200 Subject: [PATCH 8/9] [ci-on-tags.yml] Enhance in-line documentation (i.e., comments) --- .github/workflows/ci-on-tags.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-on-tags.yml b/.github/workflows/ci-on-tags.yml index 2190dd1a..eb5b790d 100644 --- a/.github/workflows/ci-on-tags.yml +++ b/.github/workflows/ci-on-tags.yml @@ -9,10 +9,11 @@ on: # Allows to run this workflow manually from the Actions tab workflow_dispatch: +# 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 env: # For the latest available docker image, see https://github.com/CODeRUS/docker-sailfishos-platform-sdk LATEST: 4.5.0.16 - # Do not wait up to the default of 10 minutes for network timeouts in a workflow which runs at most 15 minutes + # Do not wait up to the default of 10 minutes for network timeouts in a workflow which runs at most 20 minutes SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 defaults: @@ -22,8 +23,8 @@ defaults: shell: sh concurrency: - group: ${{ github.ref_name }} - cancel-in-progress: true + group: ci-${{ github.ref_name }} + 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. jobs: # One job for the latest Docker images used and one for the oldest ones. @@ -168,6 +169,6 @@ jobs: # Just for fun, see https://feathericons.com/ and # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding -#branding: # "Invalid workflow file: Unexpected value 'branding'"; maybe the name MUST be action.yml, see e.g., https://github.com/actions/cache/blob/main/action.yml#L37 +#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 # icon: 'gift' # color: 'purple' From 528207f534c84197db9d6e16e9903b4360eb92ce Mon Sep 17 00:00:00 2001 From: olf Date: Wed, 16 Aug 2023 07:43:48 +0200 Subject: [PATCH 9/9] [ci-on-pull_req.yml] Enhance in-line documentation (i.e., comments) --- .github/workflows/ci-on-pull_req.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-on-pull_req.yml b/.github/workflows/ci-on-pull_req.yml index f2df4f03..6baa7472 100644 --- a/.github/workflows/ci-on-pull_req.yml +++ b/.github/workflows/ci-on-pull_req.yml @@ -9,7 +9,7 @@ on: workflow_dispatch: env: - # Do not wait up to the default of 10 minutes for network timeouts in a workflow which runs at most 3 minutes + # Do not wait up to the default of 10 minutes for network timeouts in a workflow which runs ca. 5 minutes SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 defaults: @@ -18,9 +18,10 @@ defaults: # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell shell: sh +# 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 concurrency: - group: ${{ github.ref_name }} - cancel-in-progress: true + group: ci-${{ github.ref_name }} + 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. jobs: build: @@ -79,6 +80,6 @@ jobs: # Just for fun, see https://feathericons.com/ and # https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding -#branding: # "Invalid workflow file: Unexpected value 'branding'"; maybe the name MUST be action.yml, see e.g., https://github.com/actions/cache/blob/main/action.yml#L37 +#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 # icon: 'gift' # color: 'purple'