-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (68 loc) · 2.3 KB
/
qemu-based.yaml
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
name: Minimal test of python libraries inside QEMU
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
# All branches
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.11"
jobs:
build-test-python-install:
runs-on:
labels: ubuntu-22.04-8core
steps:
- uses: actions/checkout@v4
- name: Install needed packages
run: |
sudo apt update
sudo apt install binfmt-support qemu qemu-user-static sshpass
sudo update-binfmts --enable
- name: Install python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Build the Linux kernel for QEMU
run: ./setup-qemu-kernel.sh
- name: Build the minimal image for testing
run: |
# Make it only build up to stage-gl1
touch stage-gl2/SKIP
touch stage-gl2/SKIP_IMAGES
touch stage3/SKIP
touch stage3/SKIP_IMAGES
touch stage4/SKIP
touch stage4/SKIP_IMAGES
# Actually run the build.
./dobuild.sh
- name: List output files
run: |
pwd
ls -lh deploy
- name: Decompress the SDK image
run: |
IMAGE_BASE_PATH=$HOME/work/groundlight-pi-gen/groundlight-pi-gen/deploy
# Verify that there are files
ls -la $IMAGE_BASE_PATH
if [ ! -f $IMAGE_BASE_PATH/image_*-GroundlightPi-sdk-only-qemu.img.xz ]; then
echo "Error: The file image_*-GroundlightPi-sdk-only-qemu.img.xz does not exist."
exit 1
fi
# Decompress with xz
xz -d $IMAGE_BASE_PATH/image_*-GroundlightPi-sdk-only-qemu.img.xz
- name: Start the Emulator
run: |
IMAGE_BASE_PATH=$HOME/work/groundlight-pi-gen/groundlight-pi-gen/deploy
./rpistart.sh -i $IMAGE_BASE_PATH/image_*-GroundlightPi-sdk-only-qemu.img &
set -ex # see what's happening
# give the emulator some time to start
sleep 50
# Copy the test script
sshpass -v -p "raspberry" scp -v -P 2222 tests/test_build_works.py pi@localhost:/home/pi
# SSH into it
sshpass -v -p "raspberry" ssh -v -l pi localhost -p 2222
python test_build_works.py