-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Update workflow to support container selection
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
Showing
4 changed files
with
89 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# SPDX-FileCopyrightText: GSConnect Developers https://github.com/GSConnect | ||
# | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'backports/gnome-*' | ||
pull_request: | ||
branches: | ||
- main | ||
- '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:${{ needs.select.outputs.image_id }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prepare | ||
run: | | ||
meson --prefix=/usr \ | ||
--libdir=lib/ \ | ||
-Dgnome_shell_libdir=/usr/lib64/ \ | ||
_build | ||
- name: Uninstalled Tests | ||
run: | | ||
meson test -C _build --suite gsconnect:data \ | ||
--suite gsconnect:lint \ | ||
--print-errorlogs | ||
- name: Installed Tests | ||
run: | | ||
ninja -C _build install | ||
xvfb-run -a dbus-run-session -- \ | ||
gnome-desktop-testing-runner gsconnect -L _build/meson-logs | ||
- name: Upload Test Logs | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-logs | ||
path: _build/meson-logs | ||
|
||
- name: Test Build | ||
run: | | ||
ninja -C _build make-zip | ||
- name: Stage packaged extension | ||
run: | | ||
ninja -C _build make-pkgdir | ||
- name: Create and upload packaged artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: gsconnect@andyholmes.github.io | ||
path: _build/gsconnect@andyholmes.github.io/ | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.