Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/audit/audit.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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];
Expand Down
3 changes: 1 addition & 2 deletions src/tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading