From 2f97203bed530fc28532abc7e26ded433ae03a40 Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Tue, 17 Dec 2024 18:47:06 +0100 Subject: [PATCH] Install packages for hw tests. --- .github/workflows/ci.yml | 2 +- Makefile | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e329887bc..0556304ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1302,4 +1302,4 @@ jobs: run: | # Get the pin configuration from the file in the runner's home. source $HOME/pi-test.env - make TOIT_EXE_HW=${{ github.workspace }}/rpi/toit/bin/toit test-serial + make TOIT_EXE_HW=${{ github.workspace }}/rpi/toit/bin/toit test-hw diff --git a/Makefile b/Makefile index f3909affb..ef5fa952f 100644 --- a/Makefile +++ b/Makefile @@ -306,16 +306,28 @@ install: install-sdk test: (cd $(BUILD)/$(HOST) && ninja check_slow check_fuzzer_lib) -.PHONY: test-serial -test-serial: +.PHONY: rebuild-cmake-hw +rebuild-cmake-hw: @if [ -z "$$TOIT_EXE_HW" ]; then \ echo "TOIT_EXE_HW is not set."; \ exit 1; \ fi - mkdir -p $(BUILD)/serial - (cd $(BUILD)/serial && cmake -DTOIT_EXE_HW=$$TOIT_EXE_HW -G Ninja $(CURDIR)/tests/hw) + mkdir -p $(BUILD)/hw + (cd $(BUILD)/hw && cmake -DTOIT_EXE_HW=$$TOIT_EXE_HW -G Ninja $(CURDIR)/tests/hw) + +.PHONY: download-packages-hw-host +download-packages-hw-host: + cmake -E env TOIT_EXE_HW=$(BUILD)/$(HOST)/sdk/bin/toit $(MAKE) download-packages-hw + +.PHONY: download-packages-hw +download-packages-hw: $$TOIT_EXE_HW pkg install --project-root tests/hw/pi - (cd $(BUILD)/serial && ninja check_pi) + $$TOIT_EXE_HW pkg install --project-root tests/hw/esp32 + $$TOIT_EXE_HW pkg install --project-root tests/hw/esp-tester + +.PHONY: test-hw +test-hw: rebuild-cmake-hw download-packages-hw + (cd $(BUILD)/hw && ninja check_pi) .PHONY: build-test-assets build-test-assets: rebuild-cmake @@ -338,12 +350,12 @@ update-gold: (cd $(BUILD)/$(HOST) && ninja update_type_gold) .PHONY: test-health -test-health: download-packages +test-health: download-packages download-packages-hw-host $(MAKE) rebuild-cmake (cd $(BUILD)/$(HOST) && ninja check_health) .PHONY: update-health-gold -update-health-gold: download-packages +update-health-gold: download-packages download-packages-hw-host $(MAKE) rebuild-cmake (cd $(BUILD)/$(HOST) && ninja clear_health_gold) (cd $(BUILD)/$(HOST) && ninja update_health_gold)