-
Notifications
You must be signed in to change notification settings - Fork 0
197 lines (174 loc) · 5.68 KB
/
Copy pathci.yml
File metadata and controls
197 lines (174 loc) · 5.68 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: CI
on:
push:
branches: [main]
pull_request:
merge_group:
workflow_call:
inputs:
checkout_ref:
description: Git ref to validate instead of the triggering commit
required: false
type: string
permissions:
contents: read
packages: write
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci-image:
name: CI image
runs-on: ubuntu-latest
outputs:
name: ${{ steps.image.outputs.name }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.checkout_ref || github.sha }}
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Resolve CI image
id: image
run: |
IMAGE="$(bash scripts/ci-image-name.sh)"
echo "name=$IMAGE" >> "$GITHUB_OUTPUT"
if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- uses: docker/setup-qemu-action@v4
if: steps.image.outputs.exists != 'true'
- uses: docker/setup-buildx-action@v4
if: steps.image.outputs.exists != 'true'
- name: Build and publish CI image
if: steps.image.outputs.exists != 'true'
uses: docker/build-push-action@v7
with:
context: .
file: Containerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ steps.image.outputs.name }}
ghcr.io/luminusos/aurora-shell-ci:sha-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
lint:
name: Validate
runs-on: ubuntu-latest
needs: [ci-image]
container:
image: ${{ needs.ci-image.outputs.name }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.checkout_ref || github.sha }}
- name: Install dependencies
run: just deps
- name: Validate
run: just validate
unit-tests:
name: Unit & regression tests
runs-on: ubuntu-latest
needs: [ci-image]
container:
image: ${{ needs.ci-image.outputs.name }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.checkout_ref || github.sha }}
- name: Install dependencies
run: just deps
- name: Run unit tests
run: just test unit
build:
name: Build
runs-on: ubuntu-latest
needs: [ci-image, lint]
container:
image: ${{ needs.ci-image.outputs.name }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.checkout_ref || github.sha }}
- name: Install dependencies
run: just deps
- name: Build and inspect extension packages
run: just package check
- name: Upload extension zips
uses: actions/upload-artifact@v7
with:
name: extension-zip
path: |
dist/target/aurora-shell@luminusos.github.io.shell-extension.zip
dist/target/aurora-shell@luminusos.github.io.development.shell-extension.zip
retention-days: 1
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
needs: [ci-image, build, unit-tests]
container:
image: ${{ needs.ci-image.outputs.name }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.checkout_ref || github.sha }}
- name: Download extension zip
uses: actions/download-artifact@v8
with:
name: extension-zip
path: dist/target/
- name: Run integration tests
env:
DISPLAY: ':0'
GDK_DEBUG: no-portals
LIBGL_ALWAYS_SOFTWARE: '1'
WAYLAND_DISPLAY: gnome-shell-test-display
XDG_RUNTIME_DIR: /tmp/xdg-runtime
XDG_SESSION_ID: aurora_ci
run: |
install -d -m 0700 "$XDG_RUNTIME_DIR"
mkdir -p /run/dbus
mkdir -p /run/systemd/seats
dbus-daemon --system --fork --nopidfile
python3 -m dbusmock --system --template logind &
logind_pid=$!
python3 -m dbusmock --system --template tests/dbusmock/gdm.py &
gdm_pid=$!
trap 'kill "$logind_pid" "$gdm_pid" 2>/dev/null || true' EXIT
sleep 1
gdbus call --system \
--dest org.freedesktop.login1 \
--object-path /org/freedesktop/login1 \
--method org.freedesktop.DBus.Mock.AddMethod \
org.freedesktop.login1.Manager GetUser u o \
'ret = "/org/freedesktop/login1/user/" + str(args[0])'
gdbus call --system \
--dest org.freedesktop.login1 \
--object-path /org/freedesktop/login1 \
--method org.freedesktop.DBus.Mock.AddSession \
"$XDG_SESSION_ID" seat0 "$(id -u)" "$(id -un)" true
bash scripts/run-shell-tests.sh \
dist/target/aurora-shell@luminusos.github.io.shell-extension.zip
AURORA_DEVTOOLS=1 bash scripts/run-shell-tests.sh \
dist/target/aurora-shell@luminusos.github.io.development.shell-extension.zip \
tests/shell/auroraDevTool.js