From f05598f22c1293294e8f51f8b3890beab4f253eb Mon Sep 17 00:00:00 2001 From: Sunagatov Denis Date: Sat, 24 May 2025 07:36:30 +1100 Subject: [PATCH 1/4] Update CI actions' versions The CI build failure was caused by the deprecation of v3 artifact actions, which includes download-artifact@v3 and checkout@v3. See https://github.com/orgs/community/discussions/142581 for details. This fixes the versions of the GitHub actions so that the CI can pass. The seanmiddleditch/gha-setup-ninja action has been explicitly set to use @v6 version, since it's better for the thing to work than to break randomly. Well it's an archived repo, so like what's the difference anyway. Signed-off-by: Sunagatov Denis --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6a20b35..e8725d34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,8 @@ jobs: runs-on: windows-2022 if: github.ref == 'refs/heads/master' steps: - - uses: actions/checkout@v3 - - uses: seanmiddleditch/gha-setup-ninja@master + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@v6 - uses: ilammy/msvc-dev-cmd@v1 - uses: leafo/gh-actions-lua@v10 @@ -28,13 +28,13 @@ jobs: run: lua build.lua -shared -cuik -tb - name: upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cuik-windows path: bin/cuik.exe - name: upload dll artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cuik-windows path: bin/cuik.dll @@ -55,7 +55,7 @@ jobs: timeout-minutes: 10 - name: upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cuik-linux path: bin/cuik @@ -68,7 +68,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: seanmiddleditch/gha-setup-ninja@master + - uses: seanmiddleditch/gha-setup-ninja@v6 - uses: ilammy/msvc-dev-cmd@v1 if: runner.os == 'Windows' @@ -128,7 +128,7 @@ jobs: sha: context.sha }) - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 - name: Bundle run: | From efd3090fa82d6f5035f5297c8f0021237b3f5592 Mon Sep 17 00:00:00 2001 From: Sunagatov Denis Date: Sat, 24 May 2025 13:28:57 +1100 Subject: [PATCH 2/4] ci: Add -x64 and -a64 to build.lua flags in jobs Since the build.lua script now requires an architecture as the input we need to be providing that in the CI script, which isn't. This builds the TB and Cuik compilers with both x64 and a64 support (because for now it is simpler than making a separate build per-architecture). This also fixes the CI build script, as earlier the artifacts would not be produced without architecture flag and the script would finish with warnings and no artifacts. Signed-off-by: Sunagatov Denis --- .github/workflows/ci.yml | 7 +++++-- tb/aarch64/a64_gen.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8725d34..bb8d6858 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: Build Cuik DLL shell: cmd timeout-minutes: 10 - run: lua build.lua -shared -cuik -tb + run: lua build.lua -x64 -a64 -shared -cuik -tb - name: upload artifacts uses: actions/upload-artifact@v4 @@ -38,6 +38,7 @@ jobs: with: name: cuik-windows path: bin/cuik.dll + build_linux: runs-on: ubuntu-latest steps: @@ -51,7 +52,7 @@ jobs: run: git submodule update --init --recursive - name: Build Cuik - run: lua build.lua -driver + run: lua build.lua -x64 -a64 -driver timeout-minutes: 10 - name: upload artifacts @@ -59,6 +60,7 @@ jobs: with: name: cuik-linux path: bin/cuik + tb_unittests: strategy: matrix: @@ -99,6 +101,7 @@ jobs: - name: Run TB unittests timeout-minutes: 5 run: ./bin/tb_unittests + release: runs-on: ubuntu-latest needs: [build_win, build_linux] diff --git a/tb/aarch64/a64_gen.h b/tb/aarch64/a64_gen.h index feedd11f..e7f52628 100644 --- a/tb/aarch64/a64_gen.h +++ b/tb/aarch64/a64_gen.h @@ -70,9 +70,9 @@ static bool mach_is_subpat[512] = { #define R_POP(n, next) (((n) << 16u) | (next)) static void global_init(void) { static const uint32_t edges[] = { - (0)<<16 | (TB_ADD+1), R_PUSH(5), (0)<<16 | (TB_F32CONST+1), R_PUSH(1), (0)<<16 | (TB_F64CONST+1), R_PUSH(3), + (0)<<16 | (TB_ADD+1), R_PUSH(5), (1)<<16 | (0), 2, (2)<<16 | (TB_NULL+1), R_POP(2, 2), (3)<<16 | (0), 4, From 656e7b5a6a9a01a660e10ced0af0dcd02743a172 Mon Sep 17 00:00:00 2001 From: Sunagatov Denis Date: Sat, 24 May 2025 13:36:15 +1100 Subject: [PATCH 3/4] ci: Allow windows build on non-master refs Linux builds were executing in PRs just fine, but windows only on the master branch. This makes builds consistent, so that windows builds also happen in PRs. Signed-off-by: Sunagatov Denis --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb8d6858..e0f33a0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,6 @@ on: [pull_request, workflow_dispatch, push] jobs: build_win: runs-on: windows-2022 - if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v4 - uses: seanmiddleditch/gha-setup-ninja@v6 From 8a0d2b67e27f73b02a3421e91cc510c0e855911f Mon Sep 17 00:00:00 2001 From: Sunagatov Denis Date: Sat, 24 May 2025 13:40:48 +1100 Subject: [PATCH 4/4] ci: Use luajit for running build.lua The build.lua script runs the DSL compilation under the hood, which requires string.buffer. As far as I understand this is a feature of luajit rather than lua, so the script was failing when running with lua. Signed-off-by: Sunagatov Denis --- .github/workflows/ci.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0f33a0b..9ae39871 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,9 +9,9 @@ jobs: - uses: seanmiddleditch/gha-setup-ninja@v6 - uses: ilammy/msvc-dev-cmd@v1 - - uses: leafo/gh-actions-lua@v10 + - uses: leafo/gh-actions-lua@v11 with: - luaVersion: "5.3.0" + luaVersion: "luajit" - name: Download Submodules run: git submodule update --init --recursive @@ -44,8 +44,12 @@ jobs: - uses: actions/checkout@v3 - uses: seanmiddleditch/gha-setup-ninja@master + - uses: leafo/gh-actions-lua@v11 + with: + luaVersion: "luajit" + - name: Download LLVM & Lua - run: sudo apt-get install llvm clang lld lua5.3 + run: sudo apt-get install llvm clang lld - name: Download Submodules run: git submodule update --init --recursive @@ -74,14 +78,13 @@ jobs: - uses: ilammy/msvc-dev-cmd@v1 if: runner.os == 'Windows' - - uses: leafo/gh-actions-lua@v10 - if: runner.os == 'Windows' + - uses: leafo/gh-actions-lua@v11 with: - luaVersion: "5.3.0" + luaVersion: "luajit-2.1.0-beta3" - - name: Download LLVM & Lua + - name: Download LLVM if: runner.os == 'Linux' - run: sudo apt-get install llvm clang lld lua5.3 + run: sudo apt-get install llvm clang lld - name: Download Submodules run: git submodule update --init --recursive