From 13a042d9168dae5eaf1a41fea4fab304ff3eaed0 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 30 Jun 2026 11:53:31 -0700 Subject: [PATCH 1/3] ci: pin existing action references to full commit SHAs Mutable tag references can be silently repointed by the action owner, enabling supply-chain attacks. Pin to the commit SHA each tag currently resolves to, keeping the tag name as a comment. - actions/checkout@v6 -> df4cb1c (v6.0.3) - actions/cache@v5 -> caa2961 (v5.1.0) Signed-off-by: Brian Cain --- .github/workflows/h2_reg.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/h2_reg.yml b/.github/workflows/h2_reg.yml index 295dbc32..68dfb708 100644 --- a/.github/workflows/h2_reg.yml +++ b/.github/workflows/h2_reg.yml @@ -17,14 +17,14 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Install dependencies run: sudo apt-get update && sudo apt-get install -y libncurses5 - name: Cache Hexagon SDK id: cache-sdk - uses: actions/cache@v5 + uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0 with: path: /opt/hexagon-sdk key: hexagon-sdk-v6.4.0.2 From 8393d7edd8eec75bd9f66998720741d593fb3ac0 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 30 Jun 2026 13:36:53 -0700 Subject: [PATCH 2/3] linux: use KERNEL_BUILD_DIR for internal kernel headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit linux/makefile used -I$(KERNELPATH)/include which points to kernel/include in the source tree — a path that does not exist. Kernel-internal headers (context.h, cpuint.h, shint.h, linear.h, max.h, etc.) are generated into the build tree during the kernel build, not the source tree. Derive KERNEL_BUILD_DIR from INSTALLPATH the same way Makefile.inc.test does: KERNEL_BUILD_DIR := $(patsubst %/install,%/build/kernel,$(INSTALLPATH)) and use -I$(KERNEL_BUILD_DIR)/include in CFLAGS. Signed-off-by: Brian Cain --- linux/makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linux/makefile b/linux/makefile index f20a228a..4983cdaf 100644 --- a/linux/makefile +++ b/linux/makefile @@ -58,13 +58,15 @@ OPTIMIZE=-O2 BOOTVM_PROG := loadlinux -CFLAGS = -Wall -G0 -g $(OPTIMIZE) -mv${TOOLARCH} -DARCHV=${ARCHV} -I. -Iinc -Isrc -I$(INSTALLPATH)/include -I$(KERNELPATH)/include -L. -L$(INSTALLPATH)/lib $(EXTRA_CFLAGS) +CFLAGS = -Wall -G0 -g $(OPTIMIZE) -mv${TOOLARCH} -DARCHV=${ARCHV} -I. -Iinc -Isrc -I$(INSTALLPATH)/include -I$(KERNEL_BUILD_DIR)/include -L. -L$(INSTALLPATH)/lib $(EXTRA_CFLAGS) LDFLAGS = -L$(INSTALLPATH)/lib -moslib=h2 include ../scripts/Makefile.inc.config include ../scripts/Makefile.inc.opensource include ../scripts/Makefile.inc.bootvm +KERNEL_BUILD_DIR := $(patsubst %/install,%/build/kernel,$(INSTALLPATH)) + ifeq ($(LINUX_LINK_ADDR),) #LINUX_LINK_ADDR = $(H2K_GUEST_START) From 79162a7d0b67d333e9ebd811c3106997daab11ae Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 30 Jun 2026 11:53:51 -0700 Subject: [PATCH 3/3] ci: publish build artifacts for test suite and loadlinux Add artifact upload steps to the Build and Test workflow: - Upload test results (HTML report, JSON, test.out) after testall, with if: always() so failures are still captured. - Build loadlinux and package it with all test ELFs, bootvm_image files, booter binaries, and simulator config files (timer_v*.cfg, devsim_v*.cfg) into a single test-suite.tar.xz archive. The tarball can be extracted and used directly by hexagon-sim, archsim, or any other Hexagon simulator to re-run the test suite independently of the CI build environment. - Also publish loadlinux as a standalone artifact for convenience. - Pass explicit target name to make -C linux to avoid the default target being taken from an included makefile fragment. Signed-off-by: Brian Cain --- .github/workflows/h2_reg.yml | 48 ++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/.github/workflows/h2_reg.yml b/.github/workflows/h2_reg.yml index 68dfb708..26523310 100644 --- a/.github/workflows/h2_reg.yml +++ b/.github/workflows/h2_reg.yml @@ -43,7 +43,51 @@ jobs: run: | make -O USE_PKW=0 NULL_ANGEL_TRAP=1 testall + - name: Upload test suite artifacts + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: test-results + path: | + artifacts/test_report.html + artifacts/test.out + artifacts/**/test_results.json + artifacts/**/test_report.html + artifacts/**/test.out + if-no-files-found: warn + + - name: Build loadlinux + run: | + make -O USE_PKW=0 NULL_ANGEL_TRAP=1 ARCHV="$ARCHV" -C linux loadlinux + + - name: Package test suite archive + if: always() + run: | + tar --create --xz -h \ + --exclude='*.o' --exclude='*.d' --exclude='*.log' \ + --file artifacts/test-suite.tar.xz \ + --transform 's|^|test-suite/|' \ + artifacts/v*/*/build/tests \ + artifacts/v*/*/install/bin/booter \ + scripts/timer_v*.cfg \ + scripts/devsim_v*.cfg \ + linux/loadlinux + + - name: Upload test suite archive + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: test-suite + path: artifacts/test-suite.tar.xz + if-no-files-found: error + + - name: Upload loadlinux artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: loadlinux + path: linux/loadlinux + if-no-files-found: error + - name: Coverage build and verify run: | - make -O USE_PKW=0 NULL_ANGEL_TRAP=1 ARCHV="$ARCHV" TARGET=ref_cov cov - \ No newline at end of file + make -O USE_PKW=0 NULL_ANGEL_TRAP=1 ARCHV="$ARCHV" TARGET=ref_cov cov \ No newline at end of file