Repository navigation
208 lines (196 loc) · 6.85 KB
/
Copy pathflatpak-test.yml
File metadata and controls
208 lines (196 loc) · 6.85 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
204
205
206
207
208
on:
push:
# branches: [master]
pull_request:
name: CI
jobs:
flatpak-builder:
name: Flatpak Builder
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
cache: [use-cache, no-cache]
restore: [cache-restored, no-cache-restored]
exclude:
- arch: aarch64
cache: no-cache
- arch: aarch64
restore: no-cache-restored
- cache: no-cache
restore: cache-restored
steps:
- uses: actions/checkout@v6
# Docker is required by the docker/setup-qemu-action which enables emulation
- name: Install deps
if: ${{ matrix.arch != 'x86_64' }}
run: |
# Use the static binaries because it's unable to use a package manager
curl https://download.docker.com/linux/static/stable/x86_64/docker-26.0.0.tgz --output ./docker.tgz
tar xzvf docker.tgz
mv docker/* /usr/bin
- name: Set up QEMU
if: ${{ matrix.arch != 'x86_64' }}
uses: docker/setup-qemu-action@v4
with:
platforms: arm64
- uses: ./flatpak-builder
with:
bundle: org.example.MyApp.Devel-${{ matrix.cache }}-${{ matrix.restore }}.flatpak
manifest-path: ./flatpak-builder/tests/test-project/org.example.MyApp.yaml
cache: ${{ matrix.cache == 'use-cache' }}
restore-cache: ${{ matrix.restore == 'cache-restored' }}
cache-key: flatpak-builder-${{ github.sha }}-${{ matrix.restore }}
arch: ${{ matrix.arch }}
verbose: true
# TODO: setup a flat-manager before and use it later here
#- uses: ./flat-manager
# with:
# repository: elementary
# flat-manager-url: https://flatpak-api.elementary.io
# token: some_very_hidden_token
flatpak-builder-stop-at:
name: Flatpak Builder Stop At
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
steps:
- uses: actions/checkout@v6
- uses: ./flatpak-builder
with:
manifest-path: ./flatpak-builder/tests/test-project/org.example.MyApp.yaml
stop-at-module: testproject
cache: false
verbose: true
flatpak-builder-cache-hit:
name: Flatpak Builder Cache Hit
runs-on: ubuntu-latest
needs: flatpak-builder
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
steps:
- uses: actions/checkout@v6
- uses: ./flatpak-builder
with:
bundle: org.example.MyApp.Devel-cache-hit.flatpak
manifest-path: ./flatpak-builder/tests/test-project/org.example.MyApp.yaml
cache-key: flatpak-builder-${{ github.sha }}-no-cache-restored
verbose: true
flatpak-builder-dedicated-path-params:
name: Flatpak Builder with Dedicated Path Params
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
volumes:
- /mnt/flatpak_workflow:/mnt/flatpak_workflow
steps:
- uses: actions/checkout@v6
- uses: ./flatpak-builder
with:
manifest-path: ./flatpak-builder/tests/test-project/org.example.MyApp.yaml
build-dir: /mnt/flatpak_workflow/build-dir
repo-dir: /mnt/flatpak_workflow/repo
state-dir: /mnt/flatpak_workflow/.flatpak-builder
verbose: true
- name: Verify created directories
shell: bash
run: |
for d in \
/mnt/flatpak_workflow/build-dir \
/mnt/flatpak_workflow/repo \
/mnt/flatpak_workflow/.flatpak-builder
do
[ -d "$d" ] || { echo "::error::Directory $d does not exist"; exit 1; }
done
flatpak-builder-debug-bundle:
name: Flatpak Builder Debug Bundle
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
steps:
- uses: actions/checkout@v6
- uses: ./flatpak-builder
with:
bundle: org.example.MyApp.Devel-debug-bundle.flatpak
build-debug-bundle: true
manifest-path: ./flatpak-builder/tests/test-project/org.example.MyApp.yaml
cache-key: flatpak-builder-${{ github.sha }}-debug-bundle
verbose: true
flatpak-builder-artifact-name:
name: Flatpak Builder Artifact Name
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
strategy:
fail-fast: false
matrix:
include:
- bundle:
artifact-name:
expected-artifact: app-x86_64.flatpak
- bundle: org.example.MyApp.Devel-artifact-name.flatpak
artifact-name:
expected-artifact: org.example.MyApp.Devel-artifact-name-x86_64.flatpak
- bundle: org.example.MyApp.Devel-artifact-empty-name.flatpak
artifact-name: ""
expected-artifact: org.example.MyApp.Devel-artifact-empty-name-x86_64.flatpak
- bundle: org.example.MyApp.Devel-artifact-name.flatpak
artifact-name: org.example.MyApp.Devel-artifact-name.flatpak
expected-artifact: org.example.MyApp.Devel-artifact-name.flatpak
- bundle:
artifact-name: artifact-name-test
expected-artifact: artifact-name-test
steps:
- uses: actions/checkout@v6
- uses: ./flatpak-builder
with:
bundle: ${{ matrix.bundle }}
artifact-name: ${{ matrix.artifact-name }}
manifest-path: ./flatpak-builder/tests/test-project/org.example.MyApp.yaml
verbose: true
arch: x86_64
- uses: actions/download-artifact@v8
with:
name: ${{ matrix.expected-artifact }}
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x, 25.x]
steps:
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --also=dev
working-directory: flatpak-builder
- run: yarn test
working-directory: flatpak-builder
eslint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: "24"
- run: yarn install --also=dev
working-directory: flatpak-builder
- run: yarn run eslint .
working-directory: flatpak-builder
- run: yarn install --also=dev
working-directory: flat-manager
- run: yarn run eslint .
working-directory: flat-manager