-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (118 loc) · 5.95 KB
/
ci.yml
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
name: CI
on:
push:
branches:
- 'branch/*'
pull_request:
jobs:
smoketests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: .flatpak-builder
key: ${{ runner.os }}-flatpak-builder
- name: Install latest flatpak and flatpak-builder
run: |
sudo add-apt-repository ppa:flatpak/stable
sudo apt-get update
sudo apt-get install -y flatpak flatpak-builder jq
- name: Set up flathub remote
run: |
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- name: Get runtime version of Baseapp
run: |
runtime_version="$(jq -r '."runtime-version"' org.flatpak.Builder.BaseApp.json)"
echo "BASEAPP_RUNTIME_VERSION=${runtime_version}" >> $GITHUB_ENV
- name: Install dependencies
run: |
flatpak install -y --user flathub org.freedesktop.{Platform,Sdk{,.Extension.{rust-stable,llvm18}}}//$BASEAPP_RUNTIME_VERSION
# TODO: Remove this workaround once flatpak-builder v1.2.3 is available through the above PPA.
- name: Allow file:// clones with git>=2.38.1
run: |
git config --global protocol.file.allow always
- name: Build org.flatpak.Builder.BaseApp
run: |
jq '."branch" = "localtest"' org.flatpak.Builder.BaseApp.json >> org.flatpak.Builder.BaseApp-modified.json
git submodule update --init --recursive
flatpak-builder --verbose --user --sandbox --force-clean --repo=repo \
--default-branch=localtest --ccache \
--install builddir org.flatpak.Builder.BaseApp-modified.json
- name: Build org.flatpak.Builder
run: |
git clone --depth=1 --branch master --recursive --single-branch https://github.com/flathub/org.flatpak.Builder.git
git submodule update --init --recursive
cd org.flatpak.Builder
jq '."runtime-version" = $ENV.BASEAPP_RUNTIME_VERSION | ."base-version" = "localtest"' org.flatpak.Builder.json >> org.flatpak.Builder-modified.json
flatpak-builder --verbose --user --sandbox --force-clean --repo=repo \
--default-branch=localtest --ccache \
--install builddir org.flatpak.Builder-modified.json
- name: Check if org.flatpak.Builder launches
run: |
flatpak run org.flatpak.Builder//localtest --version
- name: Check if appstreamcli launches
run: |
flatpak run --command=appstreamcli org.flatpak.Builder//localtest vercmp 1 2
- name: Check if desktop-file-validate launches
run: |
flatpak run --command=desktop-file-validate org.flatpak.Builder//localtest --version
- name: Check if ostree launches
run: |
flatpak run --command=ostree org.flatpak.Builder//localtest --version
- name: Check if 7z works
run: |
curl -sL https://github.com/ip7z/7zip/releases/download/24.07/7z2407-src.7z > 7z-src.7z
flatpak run --filesystem=$(pwd) --command=7z org.flatpak.Builder//localtest x -y 7z-src.7z
- name: Check if rpm2cpio works
run: |
curl -sL https://archives.fedoraproject.org/pub/archive/fedora/linux/core/1/x86_64/os/Fedora/RPMS/bash-2.05b-34.x86_64.rpm > bash.rpm
flatpak run --filesystem=$(pwd) --command=rpm2cpio org.flatpak.Builder//localtest bash.rpm|cpio -i -d
- name: Check if git-lfs works
run: |
flatpak run --filesystem=$(pwd) --command=git org.flatpak.Builder//localtest lfs env
- name: Check if svn works
run: |
flatpak run --command=svn org.flatpak.Builder//localtest info --depth empty --show-item revision https://svn.code.sf.net/p/freeimage/svn/
# Needed by flatpak-github-actions
- name: Check if xvfb-run works
run: |
flatpak run --command=xvfb-run org.flatpak.Builder//localtest -a flatpak-builder --version
# Needed by flatpak-github-actions
- name: Check if dbus-daemon works
run: |
flatpak run --command=dbus-daemon org.flatpak.Builder//localtest --version
# Needed by OBS
- name: Check if gh works
run: |
flatpak run --command=gh org.flatpak.Builder//localtest --version
# Needed by OBS
- name: Check if jq works
run: |
flatpak run --command=jq org.flatpak.Builder//localtest --version
- name: Check if xmlstarlet works
run: |
flatpak run --command=xmlstarlet org.flatpak.Builder//localtest --version
- name: Sanity check the linter
run: |
flatpak run --command=flatpak-builder-lint org.flatpak.Builder//localtest --exceptions manifest org.flatpak.Builder.BaseApp.json
flatpak run --command=flatpak-builder-lint org.flatpak.Builder//localtest --exceptions builddir builddir
flatpak run --command=flatpak-builder-lint org.flatpak.Builder//localtest --exceptions repo repo
- name: Build org.freedesktop.appstream.cli with org.flatpak.Builder
run: |
git clone --depth=1 --branch master --single-branch https://github.com/flathub/org.freedesktop.appstream.cli.git
git submodule update --init --recursive
cd org.freedesktop.appstream.cli
dbus-run-session flatpak run org.flatpak.Builder//localtest --verbose --user --sandbox \
--force-clean --install-deps-from=flathub --default-branch=localtest \
--state-dir=../.flatpak-builder --ccache --disable-cache \
--install builddir org.freedesktop.appstream.cli.yaml
- name: Build io.neovim.nvim with org.flatpak.Builder
run: |
git clone --depth=1 --branch master --recursive --single-branch https://github.com/flathub/io.neovim.nvim.git
git submodule update --init --recursive
cd io.neovim.nvim
dbus-run-session flatpak run org.flatpak.Builder//localtest --verbose --user --sandbox \
--force-clean --install-deps-from=flathub --default-branch=localtest \
--state-dir=../.flatpak-builder --ccache --disable-cache --mirror-screenshots-url=https://domain.tld \
--install builddir io.neovim.nvim.yaml