From 0181276ec695fea4a06651dbfa20af4356b8fd10 Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Tue, 20 Oct 2026 14:53:33 +0200 Subject: [PATCH] ci: build the in-tree SDCC and keep it between runs The workflow and the Dockerfile install what building SDCC needs instead of the distribution's sdcc, and the workflow caches toolchain/ keyed on the contents of sdcc/. --- .github/workflows/build.yml | 12 ++++++++++-- Dockerfile | 9 ++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7097ef48..7d85b74b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,12 @@ jobs: - name: Install dependencies run: | apt update - apt install make gcc sdcc xxd python-is-python3 libjson-c-dev zlib1g-dev -y + apt install make gcc g++ bison flex libboost-dev patch bzip2 curl ca-certificates xxd python-is-python3 libjson-c-dev zlib1g-dev -y + - name: Cache the patched SDCC + uses: actions/cache@v4 + with: + path: branch/toolchain + key: sdcc-${{ hashFiles('branch/sdcc/*') }} - name: Run the host-side unit tests run: cd branch && make -C test - name: Check that every machine definition can be compiled @@ -41,7 +46,10 @@ jobs: - name: Make project with the health instrumentation run: cd branch && make clean && make CI=1 MACHINE="KP_9000_6XHML_X2" HEALTH=1 - name: Make main - run: cd main && make CI=1 MACHINE="KP_9000_6XHML_X2" && cp output/KP_9000_6XHML_X2/rtlplayground.map /tmp/main.map + run: | + ln -s ../branch/toolchain main/toolchain + PATH="$(echo "$PWD"/branch/toolchain/sdcc-*/bin):$PATH" + cd main && make CI=1 MACHINE="KP_9000_6XHML_X2" && cp output/KP_9000_6XHML_X2/rtlplayground.map /tmp/main.map - name: Calculate bank growth run: | sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/MAIN_\1=\3/p' /tmp/main.map | sort -u >> "$GITHUB_ENV" diff --git a/Dockerfile b/Dockerfile index 8942883f..c0d24e9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,14 @@ FROM debian:13-slim RUN apt-get update && apt-get install -y \ make \ gcc \ - sdcc \ + g++ \ + bison \ + flex \ + libboost-dev \ + patch \ + bzip2 \ + curl \ + ca-certificates \ xxd \ python3 \ libjson-c-dev \