From 0f02b4ea94281d056371b757efa95a3b1320fd9b Mon Sep 17 00:00:00 2001 From: Jeremy Collins Date: Fri, 27 Nov 2026 15:20:10 -0500 Subject: [PATCH] Run only a quick check on pull requests The QA agents gate pull requests with the status qa/linux, so CI on a pull request runs only the format check and a build. Pushes to main and the scheduled run run the full set, as before. Two files get the format of zig fmt, so that the new check passes. --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++---- src/audit/audit.zig | 12 ++++++------ src/tests.zig | 3 +-- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88b5a2c..4419d1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,11 @@ env: ZIG_VERSION: "0.17.0" jobs: + # A pull request runs only the quick check. The QA agents test it on + # our machines and post the status qa/linux (docs/dev/ci.md of ztcl). test: name: Test (Linux) + if: github.event_name != 'pull_request' runs-on: ubuntu-latest steps: - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 @@ -64,6 +67,7 @@ jobs: skill: name: Skill (Linux) + if: github.event_name != 'pull_request' runs-on: ubuntu-latest steps: - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 @@ -86,6 +90,27 @@ jobs: - name: Test the skill as a sandbox uses it run: tools/skill-test.sh + # The quick check of a pull request: the format and a build. + quick: + name: Quick check + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 + - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 + with: + version: ${{ env.ZIG_VERSION }} + - name: Check the format + run: zig fmt --check build.zig src + - name: Install the Linux build dependencies + run: | + sudo apt-get update + sudo apt-get install -y glslc libwayland-dev libxkbcommon-dev wayland-protocols + - name: Build + run: | + ulimit -v 6000000 + zig build install + # A failure of the scheduled full run opens an issue, so it is fixed # in the next batch of work. report: @@ -104,13 +129,13 @@ jobs: --title "The full CI run failed on $(date -u +%Y-%m-%d)" \ --body "The scheduled full run failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # The one check for the merge: it passes when each job of the run - # passed or was skipped, and fails when a job failed or was - # cancelled. + # The one check of a run: it passes when each job of the run passed + # or was skipped, and fails when a job failed or was cancelled. On a + # pull request it is advisory: the gate is the status qa/linux. linux-ok: name: Linux ok if: always() - needs: [test, skill] + needs: [quick, test, skill] runs-on: ubuntu-latest steps: - name: Check the results of the jobs diff --git a/src/audit/audit.zig b/src/audit/audit.zig index 37bef85..543bf0d 100644 --- a/src/audit/audit.zig +++ b/src/audit/audit.zig @@ -513,7 +513,7 @@ fn map(p: [:0]const u8) ?[]const u8 { } fn unmap(m: []const u8) void { - _ = c.munmap(@alignCast(@ptrCast(m.ptr)), m.len); + _ = c.munmap(@ptrCast(@alignCast(m.ptr)), m.len); } fn hexHash(text: []const u8) [64]u8 { @@ -639,11 +639,11 @@ const FieldType = enum { str, int, bool, strs, sdict, nstr, json }; fn fieldType(name: []const u8) FieldType { const map_ = .{ - .{ "pid", .int }, .{ "ppid", .int }, .{ "code", .int }, .{ "ms", .int }, - .{ "port", .int }, .{ "up", .int }, .{ "down", .int }, .{ "exit", .int }, - .{ "size", .int }, .{ "sandbox", .bool }, .{ "ok", .bool }, .{ "argv", .strs }, - .{ "targets", .strs }, .{ "answers", .strs }, .{ "input", .sdict }, .{ "before", .nstr }, - .{ "after", .nstr }, .{ "diff", .nstr }, .{ "output", .json }, .{ "files", .json }, + .{ "pid", .int }, .{ "ppid", .int }, .{ "code", .int }, .{ "ms", .int }, + .{ "port", .int }, .{ "up", .int }, .{ "down", .int }, .{ "exit", .int }, + .{ "size", .int }, .{ "sandbox", .bool }, .{ "ok", .bool }, .{ "argv", .strs }, + .{ "targets", .strs }, .{ "answers", .strs }, .{ "input", .sdict }, .{ "before", .nstr }, + .{ "after", .nstr }, .{ "diff", .nstr }, .{ "output", .json }, .{ "files", .json }, .{ "response", .json }, }; inline for (map_) |m| if (std.mem.eql(u8, name, m[0])) return m[1]; diff --git a/src/tests.zig b/src/tests.zig index 82561a7..5f9626c 100644 --- a/src/tests.zig +++ b/src/tests.zig @@ -116,8 +116,7 @@ const Run = struct { try std.fmt.allocPrintSentinel(a, "TEMP={s}", .{t}, 0), try std.fmt.allocPrintSentinel(a, "TMP={s}", .{t}, 0), }); - } else - try a.dupe([:0]const u8, &.{ "PATH=" ++ test_path, "HOME=/tmp", "PS1=$ " }); + } else try a.dupe([:0]const u8, &.{ "PATH=" ++ test_path, "HOME=/tmp", "PS1=$ " }); try host.allow(&r.it, folder, env); // The folder of the ztk programs has the ztk program of the build, // for the target of this computer: a link, or a copy on Windows,