Skip to content

Commit 0833b97

Browse files
committed
Add local tests to build system and CI
Add a "make test" target to the Makefile and to CI. This is intended to run all tests that can be run locally, with just one for now. For now, knowledge of the specific artifacts required is duplicated between the Makefile and .github/workflows/test.yml. I don't like this, but this is currently necessary because the workflows are split and save and restore artifacts between building and testing. Perhaps this can be improved, but I'm deferring this for a possible future overhaul. Signed-off-by: Robie Basak <[email protected]>
1 parent cab1335 commit 0833b97

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,22 @@ jobs:
109109
echo " * [Job $JOB_ID on $DEVICE_TYPE]($URL)"
110110
echo " * [Job $JOB_ID on $DEVICE_TYPE]($URL)" >> $GITHUB_STEP_SUMMARY
111111
done
112+
local-tests:
113+
name: "Local tests"
114+
runs-on: ubuntu-latest
115+
116+
steps:
117+
- name: Install dependencies
118+
run: apt-get update && apt-get -y install make python3-pyexpect python3-pytest qemu-efi-aarch64 qemu-system-arm
119+
- name: Clone repository
120+
uses: actions/checkout@v4
121+
with:
122+
fetch-depth: 0
123+
- name: Download build artifacts
124+
uses: actions/download-artifact@v4
125+
with:
126+
name: disk-ufs.img.gz
127+
- name: Decompress required build artifacts
128+
run: gzip -d disk-ufs.img.gz
129+
- name: Invoke test runner
130+
run: make test

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ all: disk-ufs.img.gz disk-sdcard.img.gz
1717
rootfs.tar.gz: debos-recipes/qualcomm-linux-debian-rootfs.yaml
1818
$(DEBOS) $<
1919

20-
disk-ufs.img.gz: debos-recipes/qualcomm-linux-debian-image.yaml rootfs.tar.gz
20+
disk-ufs.img disk-ufs.img.gz: debos-recipes/qualcomm-linux-debian-image.yaml rootfs.tar.gz
2121
$(DEBOS) $<
2222

2323
disk-sdcard.img.gz: debos-recipes/qualcomm-linux-debian-image.yaml rootfs.tar.gz
2424
$(DEBOS) -t imagetype:sdcard $<
2525

26-
.PHONY: all
26+
test: disk-ufs.img
27+
py.test-3
28+
29+
.PHONY: all test

0 commit comments

Comments
 (0)