diff --git a/.github/workflows/ci-on-pull_req.yml b/.github/workflows/ci-on-pull_req.yml index da3a5d99..6baa7472 100644 --- a/.github/workflows/ci-on-pull_req.yml +++ b/.github/workflows/ci-on-pull_req.yml @@ -1,17 +1,36 @@ -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 ca. 5 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 + +# 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: 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: 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 +47,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 +60,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 +77,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: # "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' diff --git a/.github/workflows/ci-on-tags.yml b/.github/workflows/ci-on-tags.yml index 095f34c1..eb5b790d 100644 --- a/.github/workflows/ci-on-tags.yml +++ b/.github/workflows/ci-on-tags.yml @@ -3,18 +3,41 @@ name: CI on tags on: push: tags: - - '*' + # '**' 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: +# 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 20 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: 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: - 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 +54,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 +68,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 +80,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 +91,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 +134,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 +149,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 +166,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: # "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'