Skip to content

Commit 38455bf

Browse files
committed
Run CI on QEMU
1 parent ec02efb commit 38455bf

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/qemu.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
5+
name: Run under QEMU
6+
7+
on:
8+
workflow_dispatch:
9+
pull_request:
10+
push:
11+
branches:
12+
- master
13+
14+
jobs:
15+
build:
16+
name: Run under bubblewrap
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- name: Install qemu
20+
run: sudo apt-get install qemu-system-x86
21+
- name: Checkout repo
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
# There is a strange bug(?) in nongnu, when you clone a git repository
26+
# against a commit != HEAD with depth=1, it errors out.
27+
fetch-depth: 0
28+
- name: Query cache for sources
29+
id: cache
30+
uses: actions/cache/restore@v4
31+
with:
32+
path: |
33+
mirror
34+
mirror-state
35+
key: cache-${{ hashFiles('steps/*/sources') }}
36+
restore-keys: |
37+
cache-
38+
- name: Get sources
39+
if: steps.cache.outputs.cache-hit != 'true'
40+
run: mkdir -p mirror mirror-state && ./mirror.sh mirror mirror-state
41+
- name: Cache sources
42+
if: steps.cache.outputs.cache-hit != 'true'
43+
uses: actions/cache/save@v4
44+
with:
45+
path: |
46+
mirror
47+
mirror-state
48+
key: cache-${{ hashFiles('steps/*/sources') }}
49+
- name: Run bootstrap
50+
run: ./rootfs.py --qemu --external-sources --cores 2 --mirror file://${PWD}/mirror
51+
- name: Remount package disk
52+
if: always()
53+
run: >
54+
DEV=$(sudo losetup -f target/external.img) &&
55+
sudo partprobe ${DEV}p1 &&
56+
mkdir -p mnt &&
57+
sudo mount ${DEV}p1 mnt
58+
- name: Archive created packages
59+
if: always() # archive both failed and successful builds
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: packages
63+
path: mnt/repo/**

0 commit comments

Comments
 (0)