-
Notifications
You must be signed in to change notification settings - Fork 57
79 lines (74 loc) · 2.2 KB
/
test-action.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
name: Test
# Trigger the workflow on push or pull request
on:
push:
paths:
- 'zram-config'
- 'ztab'
- '**.bash'
- 'tests/**'
- '.github/workflows/test-action.yml'
pull_request:
paths:
- 'zram-config'
- 'ztab'
- '**.bash'
- 'tests/**'
- '.github/workflows/test-action.yml'
jobs:
test:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup environment
run: |
sudo -E bash -c set
sudo apt-get update
sudo apt-get install --yes expect systemd-container qemu-user-static qemu-utils qemu-system-arm libfdt-dev binfmt-support
- name: Add custom stage
run: |
mkdir -p test-stage/00-install-packages &&
{
cat > test-stage/00-install-packages/00-packages <<-EOF
gcc meson libc6-dev
EOF
} &&
{
cat > test-stage/prerun.sh <<-EOF
#!/bin/bash -e
if [ ! -d "\${ROOTFS_DIR}" ]; then
copy_previous
fi
EOF
} &&
chmod +x test-stage/prerun.sh
- name: Build image
id: build
uses: usimd/[email protected]
with:
image-name: raspios
compression: none
pi-gen-version: master
verbose-output: true
stage-list: stage0 stage1 stage2 ./test-stage
- name: Build image
run: sudo -E ./tests/image.bash "setup" "${{ steps.build.outputs.image-path }}"
shell: bash
- name: Run tests
run: |
mv "${{ steps.build.outputs.image-path }}" raspios.img
sudo expect ./tests/run.exp
shell: bash
- name: Copy logs
if: always()
run: sudo ./tests/image.bash "copy-logs" "raspios.img"
- name: Upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: logs.tar.gz
path: logs.tar.gz