-
Notifications
You must be signed in to change notification settings - Fork 0
203 lines (165 loc) · 6.47 KB
/
ci.yml
File metadata and controls
203 lines (165 loc) · 6.47 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
198
199
200
201
202
203
on:
workflow_call:
permissions:
contents: read
defaults:
run:
shell: bash
env:
DEVTOOLS_COLOR: always
FORCE_COLOR: 1
jobs:
actionlint:
runs-on: ubuntu-24.04
env:
# renovate: datasource=github-releases depName=rhysd/actionlint
ACTIONLINT_VERSION: 1.7.11
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- working-directory: ${{ runner.temp }}
run: |
wget "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
mkdir actionlint
tar -C actionlint -xf "actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
echo "$(pwd)/actionlint" >>"$GITHUB_PATH"
wget "https://raw.githubusercontent.com/rhysd/actionlint/v${ACTIONLINT_VERSION}/.github/actionlint-matcher.json"
echo "::add-matcher::$(pwd)/actionlint-matcher.json"
- run: actionlint -verbose -color
shellcheck:
strategy:
fail-fast: false
matrix:
package:
- gnome-shell-extension-ddterm
- gnome-shell-extension-ddterm-git
runs-on: ubuntu-24.04
container:
image: ghcr.io/archlinux/archlinux:base-devel-20260414.0.514366@sha256:2aba004a310a2a801fe78b43b527207185e725c64c3ea97b72fea06cb55a232b
steps:
- run: pacman -Sy --noconfirm shellcheck git
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: git config --global --replace-all safe.directory "$GITHUB_WORKSPACE"
- run: echo '::add-matcher::.github/shellcheck-gcc-problem-matcher.json'
- run: shellcheck --format=gcc "$PACKAGE_NAME/PKGBUILD" "$PACKAGE_NAME"/*.install
env:
PACKAGE_NAME: ${{ matrix.package }}
package:
strategy:
fail-fast: false
matrix:
package:
- gnome-shell-extension-ddterm
- gnome-shell-extension-ddterm-git
runs-on: ubuntu-24.04
container:
image: ghcr.io/archlinux/archlinux:base-devel-20260414.0.514366@sha256:2aba004a310a2a801fe78b43b527207185e725c64c3ea97b72fea06cb55a232b
options: --privileged --tmpfs /run
steps:
- run: sed -i '/^NoExtract/d' /etc/pacman.conf
- run: echo "$REPO_CONFIG" >> /etc/pacman.conf
env:
REPO_CONFIG: |
[ddterm]
SigLevel = Never
Server = https://ddterm.github.io/aur
- run: pacman -Sy --noconfirm --noprogressbar --color=always devtools
- run: systemd-machine-id-setup
- run: useradd -m builduser
- run: echo "$GITHUB_WORKSPACE/.github/bin" >> "$GITHUB_PATH"
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: git config --global --replace-all safe.directory "$GITHUB_WORKSPACE"
- run: chown -R builduser .
- run: sudo -u builduser makepkg --printsrcinfo | tee .SRCINFO
working-directory: ${{ matrix.package }}
- run: git diff --exit-code .SRCINFO
working-directory: ${{ matrix.package }}
- run: sudo -u builduser makepkg --allsource
working-directory: ${{ matrix.package }}
- run: mkarchroot -C /etc/pacman.conf -M /etc/makepkg.conf /var/tmp/root base-devel
- run: makechrootpkg -r /var/tmp -c -n -C -U builduser -- --holdver
working-directory: ${{ matrix.package }}
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.package }}-pkg
path: |
${{ matrix.package }}/*.src.tar.*
${{ matrix.package }}/*.pkg.tar.*
${{ matrix.package }}/*.log
if-no-files-found: error
if: always()
installed-test:
strategy:
fail-fast: false
matrix:
package:
- gnome-shell-extension-ddterm
- gnome-shell-extension-ddterm-git
needs: package
runs-on: ubuntu-24.04
container:
image: ghcr.io/archlinux/archlinux:base-devel-20260414.0.514366@sha256:2aba004a310a2a801fe78b43b527207185e725c64c3ea97b72fea06cb55a232b
options: --privileged --tmpfs /run
steps:
- run: |
# https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0
sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- run: pacman -Syu --noconfirm git
- run: systemd-machine-id-setup
- run: useradd -m builduser
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: installed-test
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: ${{ matrix.package }}-pkg
- run: rm -v ./*.log
- run: pacman --noconfirm -U ./*.pkg.tar.*
- run: tar xf ./*.src.tar.*
- run: chown -R builduser .
working-directory: ${{ matrix.package }}
- run: sudo -u builduser makepkg --noprepare --nobuild --holdver --nodeps
working-directory: ${{ matrix.package }}
- id: runtest
run: >-
"$GITHUB_WORKSPACE/installed-test/$PACKAGE_NAME.sh"
working-directory: ${{ matrix.package }}/src
env:
PACKAGE_NAME: ${{ matrix.package }}
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.package }}-test
path: ${{ steps.runtest.outputs.reports }}
if-no-files-found: error
if: always() && steps.runtest.outputs.reports
repo:
needs:
- package
- installed-test
runs-on: ubuntu-24.04
container:
image: ghcr.io/archlinux/archlinux:base-devel-20260414.0.514366@sha256:2aba004a310a2a801fe78b43b527207185e725c64c3ea97b72fea06cb55a232b
steps:
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
path: repo
pattern: '*-pkg'
merge-multiple: true
- run: rm ./*.log
working-directory: repo
- run: repo-add ddterm.db.tar.zst ./*.pkg.tar.*
working-directory: repo
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
path: repo
pattern: '*-test'
merge-multiple: false
- run: pacman -Sy --noconfirm tree
- run: >-
find . -type d -exec bash -c
'tree "$0" -h --du -H "/${GITHUB_REPOSITORY#*/}/${0:2}" -o "$0/index.html"'
'{}' ';'
working-directory: repo
- uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
path: repo