forked from GSConnect/gnome-shell-extension-gsconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (85 loc) · 2.72 KB
/
Copy pathci.yml
File metadata and controls
98 lines (85 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# 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@v6
- name: Install node modules
run: npm install
- 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
if [[ \
${{ startsWith(env.TARGET_BRANCH, 'backports/gnome-42') && 1 || 0 }} == 1 \
]]; then
glib-compile-schemas /usr/share/glib-2.0/schemas/
fi
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@v5
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@v5
with:
name: gsconnect@andyholmes.github.io
path: _build/gsconnect@andyholmes.github.io/