Skip to content

Commit

Permalink
CI: Update workflow to support container selection
Browse files Browse the repository at this point in the history
Update the primary CI workflow (renamed from 'main.yml' to 'ci.yml')
to also build for PRs and pushes targeting branches with names of the
form `backports/gnome-*`, and select the corresponding image from
`GSConnect/gsconnect-ci` tagged as `gnome-##`.

This will allow testing branches against GNOME versions other than the
default/current, without requiring separate workflows with near-duplicate
content like the previous `gnome-3-3[68].yml`. (Those are deleted.)
  • Loading branch information
ferdnyc committed Feb 28, 2025
1 parent fb9155b commit 4889447
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 113 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/main.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,43 @@ on:
push:
branches:
- main
- gnome-43
- 'backports/gnome-*'
pull_request:
branches:
- main
- gnome-43
- 'backports/gnome-*'
workflow_dispatch:

jobs:
select:
runs-on: ubuntu-latest
outputs:
image_id: ${{ steps.select-image.outputs.image_id }}
steps:
- id: step1
if: ${{ ! startsWith(github.event_name, 'pull_request') }}
run: echo "target=${{ github.ref_name }}" >> $GITHUB_OUTPUT
- id: step2
if: ${{ startsWith(github.event_name, 'pull_request') }}
run: echo "target=${{ github.base_ref }}" >> $GITHUB_OUTPUT
- id: select-image
env:
TARGET_BRANCH: ${{ steps.step1.outputs.target || steps.step2.outputs.target }}
run: |
if [[ \
${{ startsWith(env.TARGET_BRANCH, 'backports/') && 1 || 0 }} == 1 \
]]; then
IMAGE_ID=$(echo "$TARGET_BRANCH" | sed -e 's,^backports/,,')
echo "image_id=$IMAGE_ID" >> $GITHUB_OUTPUT
else
echo "image_id=latest" >> $GITHUB_OUTPUT
fi
test:
needs: select
runs-on: ubuntu-latest
container:
image: ghcr.io/gsconnect/gsconnect-ci:main
image: ghcr.io/gsconnect/gsconnect-ci:${{ needs.select.outputs.image_id }}
steps:
- uses: actions/checkout@v4

Expand Down
55 changes: 0 additions & 55 deletions .github/workflows/gnome-3-36.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/gnome-3-38.yml

This file was deleted.

0 comments on commit 4889447

Please # to comment.