Skip to content

Commit 0f47992

Browse files
committed
Use snapd branch
1 parent 6c8d9ea commit 0f47992

File tree

4 files changed

+48
-7
lines changed

4 files changed

+48
-7
lines changed

.github/workflows/tests.yaml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,39 @@ on:
1111
- main
1212

1313
jobs:
14+
build-snapd-deb:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
repository: 'valentindavid/snapd'
20+
path: snapd
21+
ref: 'valentindavid/udev-scan-disk'
22+
- name: Build snapd deb
23+
working-directory: '${{ github.workspace }}/snapd'
24+
run: |
25+
sudo apt update
26+
sudo DEBIAN_FRONTEND=noninteractive apt build-dep -yqq --no-install-recommends ./
27+
bash get-deps.sh
28+
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: snapd
32+
path: "${{ github.workspace }}/snapd_*.deb"
33+
1434
build:
1535
runs-on: [ self-hosted, spread-enabled ]
36+
needs: build-snapd-deb
1637
steps:
1738
- name: Cleanup job workspace
1839
id: cleanup-job-workspace
1940
run: |
2041
rm -rf "${{ github.workspace }}"
2142
mkdir "${{ github.workspace }}"
2243
- uses: actions/checkout@v4
44+
- uses: actions/download-artifact@v4
45+
with:
46+
name: snapd
2347

2448
- name: Build snap
2549
run: |
@@ -41,14 +65,19 @@ jobs:
4165
4266
tests-main:
4367
runs-on: [ self-hosted, spread-enabled ]
44-
needs: build
68+
needs:
69+
- build
70+
- build-snapd-deb
4571
steps:
4672
- name: Cleanup job workspace
4773
id: cleanup-job-workspace
4874
run: |
4975
rm -rf "${{ github.workspace }}"
5076
mkdir "${{ github.workspace }}"
5177
- uses: actions/checkout@v4
78+
- uses: actions/download-artifact@v4
79+
with:
80+
name: snapd
5281
- uses: actions/download-artifact@v4
5382
with:
5483
name: snaps
@@ -66,7 +95,9 @@ jobs:
6695
done
6796
tests-snapd:
6897
runs-on: ubuntu-latest
69-
needs: build
98+
needs:
99+
- build
100+
- build-snapd-deb
70101
steps:
71102
- name: Cleanup job workspace
72103
id: cleanup-job-workspace
@@ -79,8 +110,12 @@ jobs:
79110
path: core-initrd
80111
- uses: actions/checkout@v4
81112
with:
82-
repository: 'snapcore/snapd'
113+
repository: 'valentindavid/snapd'
83114
path: snapd
115+
ref: 'valentindavid/udev-scan-disk'
116+
- uses: actions/download-artifact@v4
117+
with:
118+
name: snapd
84119
- uses: actions/download-artifact@v4
85120
with:
86121
name: snaps
@@ -94,7 +129,7 @@ jobs:
94129
. "core-initrd/tests/lib/prepare-utils.sh"
95130
96131
echo "************* INSTALLING DEPS *************"
97-
install_core_initrd_deps '${{ github.workspace }}/core-initrd'
132+
install_core_initrd_deps '${{ github.workspace }}/core-initrd' '${{ github.workspace }}'/snapd_*.deb
98133
99134
echo "************* DOWNLOADING SNAPS *************"
100135
download_core_initrd_snaps 'edge'

tests/lib/prepare-uc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -x
77
. "$TESTSLIB/prepare-utils.sh"
88

99
# install dependencies
10-
install_core_initrd_deps "$PROJECT_PATH"
10+
install_core_initrd_deps "$PROJECT_PATH" "$PROJECT_PATH"/snapd_*.deb
1111

1212
# TODO: is this still necessary for core-initrd? (this was copied from snapd)
1313
# create test user for spread to use

tests/lib/prepare-utils.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ start_snapd_core_vm() {
117117

118118
install_core_initrd_deps() {
119119
local project_dir="$1"
120+
if [ -n "${2-}" ]; then
121+
snapd_deb="$(realpath "$2")"
122+
else
123+
snapd_deb=snapd
124+
fi
120125

121126
# needed for dracut which is a build-dep of ubuntu-core-initramfs
122127
# and for the version of snapd here which we want to use to pull snap-bootstrap
@@ -128,7 +133,8 @@ install_core_initrd_deps() {
128133

129134
# these are already installed in the lxd image which speeds things up, but they
130135
# are missing in qemu and google images.
131-
sudo DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -o Dpkg::Options::="--force-confnew" psmisc fdisk snapd mtools ovmf qemu-system-x86 sshpass whois openssh-server -yqq
136+
sudo DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -o Dpkg::Options::="--force-confnew" psmisc fdisk mtools ovmf qemu-system-x86 sshpass whois openssh-server -yqq
137+
sudo DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends --allow-downgrades "${snapd_deb}" -yqq
132138

133139
# use the snapd snap explicitly
134140
# TODO: since ubuntu-image ships it's own version of `snap prepare-image`,

tests/spread/build/build-initrd/task.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ prepare: |
99
. "$TESTSLIB/prepare-utils.sh"
1010
1111
# install dependencies
12-
install_core_initrd_deps "$PROJECT_PATH"
12+
install_core_initrd_deps "$PROJECT_PATH" "$PROJECT_PATH"/snapd_*.deb
1313
1414
# download pc-kernel and pc gadget
1515
# FIXME: switch to 24 channel when available

0 commit comments

Comments
 (0)