From bf7f603dd4e8ec781fe578243cdc18180322420b Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Thu, 1 Oct 2026 09:25:04 -0700 Subject: Fix CI --- .github/workflows/ci.yml | 18 ++++++++++++++++++ .github/workflows/maven.yml | 19 ------------------- README.md | 6 +++++- chapter25/Makefile | 2 +- .../java/com/seaofnodes/simple/Chapter21Test.java | 2 +- .../java/com/seaofnodes/simple/Chapter25Test.java | 5 ++--- skills/chapter25-codex-notes.md | 4 ++++ 7 files changed, 31 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..67ab702c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +name: Java CI with Make + +on: [ push, pull_request ] + +jobs: + test: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'temurin' + - name: Build and test all chapters + run: make lib tests CTAGS= diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index 26c2a083..00000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Java CI with Maven - -on: [ push, pull_request ] - -jobs: - test: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 21 - uses: actions/setup-java@v3 - with: - java-version: '21' - distribution: 'temurin' - cache: 'maven' - - name: Build with Maven - run: mvn --batch-mode --update-snapshots verify diff --git a/README.md b/README.md index e75fa42a..ef31f64e 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,11 @@ Chapters 10a, 10b, and 18–25 launch it with `make view` from the chapter direc The top-level Makefile runs each chapter's `tests`, `tags` (also `tag`), `release`, or `lib` target. Start with `make lib` on a fresh checkout, then -`make tests`. +`make tests`. + +CI runs `make lib tests CTAGS=` on Linux with JDK 21. The Make targets also build +Chapter 25's native runtime and `sys` library before running the tests that use +them; Maven's Java build alone does not produce those prerequisites. The [chapter backport queue](docs/chapter-backports.md) records proposed small corrections and the per-chapter test/review workflow. Larger architectural moves diff --git a/chapter25/Makefile b/chapter25/Makefile index fb71fc6b..14a4c2a2 100644 --- a/chapter25/Makefile +++ b/chapter25/Makefile @@ -146,7 +146,7 @@ $(CLZDIR)/test/.ttag: $(test_javas) $(CLZDIR)/main/.mtag OBJS:= build/objs SYS_SMPS:= $(wildcard src/main/smp/*.smp src/main/smp/*/*.smp src/main/smp/*/*/*.smp) CPU_PORT:= x86_64_v2 -CALL_CONV:= win64 +CALL_CONV:= $(if $(filter Windows_NT,$(OS)),win64,SystemV) CPU_ABI:= $(CPU_PORT)_$(CALL_CONV) RELEASE:= build/release TEST_SYS:= $(OBJS)/lib_$(CPU_ABI)/sys.o diff --git a/chapter25/src/test/java/com/seaofnodes/simple/Chapter21Test.java b/chapter25/src/test/java/com/seaofnodes/simple/Chapter21Test.java index 08da0654..a400dc5f 100644 --- a/chapter25/src/test/java/com/seaofnodes/simple/Chapter21Test.java +++ b/chapter25/src/test/java/com/seaofnodes/simple/Chapter21Test.java @@ -424,7 +424,7 @@ val test_sqrt = { flt x -> } }; """; - TestC.runC(src, "newtonFloat", result, 42); + TestC.runC(src, "newtonFloat", result, TestC.CALL_CONVENTION.equals("win64") ? 42 : 34); EvalRisc5 R5 = TestRisc5.build( src, "test_sqrt", 0, 10, false); R5.fregs[riscv.FA0 - riscv.F_OFFSET] = 3.0; diff --git a/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java b/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java index 346c503a..7158ace0 100644 --- a/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java +++ b/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java @@ -98,7 +98,7 @@ public class Chapter25Test { new CodeGen(root.toString(),root.toString(),imported ? paths : null,"Main",src,126,true,TypeInteger.BOT) .driver(TestC.CPU_PORT,TestC.CALL_CONVENTION,false,false); assertEquals("",TestC.gcc(root+"/Main.o","",TestC.C_DRIVERS_DIR+"extern_data_import.c", - (String)null,new Ary<>(new String[]{dir+"/Globals.o"}),root+"/main"+(TestC.OS.startsWith("Windows") ? ".exe" : ""))); + (String)null,new Ary<>(new String[]{dir+"/Globals.o"}),root+"/program"+(TestC.OS.startsWith("Windows") ? ".exe" : ""))); } } @@ -364,8 +364,7 @@ public class Chapter25Test { String syms = run(new String[]{"nm",obj}); assertTrue(syms, syms.contains(" U sys.io.p_noInline")); - String out = run(new String[]{"gcc",obj,SYS_FILE.toString(),TestC.runtimeObject(),"-lm","-g","-o",exe}); - assertEquals("",out); + TestC.linkExe(obj,null,null,new Ary<>(new String[]{SYS_FILE.toString()}),exe); String rez = run(new String[]{exe}); assertEquals(expected,rez); } diff --git a/skills/chapter25-codex-notes.md b/skills/chapter25-codex-notes.md index d4f9bf2c..041eba8f 100644 --- a/skills/chapter25-codex-notes.md +++ b/skills/chapter25-codex-notes.md @@ -711,6 +711,10 @@ Consequences: `helloWorld`, Chapter25Test uses `helloWorldSys`, and driver variants have separate output directories. `NativeExecutionTest` covers overwriting an executable between link and execution, full exit statuses, and driver errors. +9. CI uses `make lib tests CTAGS=` so native runtime and sys prerequisites are + built. Chapter 25's default ABI must match TestC: win64 on Windows, SystemV + elsewhere. Native spill expectations can differ by ABI (Newton is 42/34); + validate Linux as well as Windows when changing native test setup. Useful test ladder: -- cgit v1.2.3