Skip to content

Commit

Permalink
Merge pull request #49 from kivikakk/unnix-in-ci
Browse files Browse the repository at this point in the history
un-Nix in CI.
  • Loading branch information
kivikakk authored Apr 28, 2024
2 parents 83a99f6 + b077978 commit 55f0339
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 124 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix build '.?submodules=1#specs' -L
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.12.0
- run: make spec
42 changes: 25 additions & 17 deletions .github/workflows/zig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,38 @@ on:
pull_request:

jobs:
test-nix:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.12.0
- run: zig build
- run: zig build test
test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix build '.?submodules=1' -L
- uses: goto-bus-stop/setup-zig@2a9625d550eefc3a9b1a43d342ad655f563f8241
with:
version: 0.12.0
- run: brew install pcre
- run: zig build
- run: zig build test
test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: goto-bus-stop/setup-zig@v1
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.11.0
version: 0.12.0
- run: c:; cd \vcpkg; git pull; .\bootstrap-vcpkg.bat
- run: vcpkg integrate install
- run: vcpkg install pcre --triplet x64-windows-static
Expand All @@ -39,8 +48,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix develop --command zig fmt --check src/*.zig
- uses: goto-bus-stop/setup-zig@v2
with:
version: 0.12.0
- run: zig fmt --check src/*.zig
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/zig-*
koino.code-workspace
/result*
1 change: 1 addition & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ fn addCommonRequirements(cs: *std.Build.Step.Compile, deps: *const std.StringHas
while (it.next()) |entry| {
cs.root_module.addImport(entry.key_ptr.*, entry.value_ptr.*);
}
cs.linkLibC();
}
58 changes: 0 additions & 58 deletions flake.lock

This file was deleted.

38 changes: 0 additions & 38 deletions flake.nix

This file was deleted.

6 changes: 4 additions & 2 deletions src/strings.zig
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ test "trim" {
pub fn trimIt(al: *std.ArrayList(u8)) void {
const trimmed = trim(al.items);
if (al.items.ptr == trimmed.ptr and al.items.len == trimmed.len) return;
@memcpy(al.items, trimmed);
if (&al.items != &trimmed) {
mem.copyForwards(u8, al.items, trimmed);
}
al.items.len = trimmed.len;
}

Expand Down Expand Up @@ -287,7 +289,7 @@ pub fn unescapeInto(text: []const u8, out: *std.ArrayList(u8)) !?usize {
return null;
if (text[i] == ';') {
var key = [_]u8{'&'} ++ [_]u8{';'} ** (ENTITY_MAX_LENGTH + 1);
@memcpy(key[1..], text[0..i]);
@memcpy(key[1 .. i + 1], text[0..i]);

if (htmlentities.lookup(key[0 .. i + 2])) |item| {
try out.appendSlice(item.characters);
Expand Down
2 changes: 1 addition & 1 deletion vendor/htmlentities
2 changes: 1 addition & 1 deletion vendor/libpcre
2 changes: 1 addition & 1 deletion vendor/zunicode

0 comments on commit 55f0339

Please sign in to comment.