Skip to content

Commit cc17067

Browse files
committed
flake.nix: use zig 0.12.0 from zig-overlay.
1 parent dae66f3 commit cc17067

File tree

4 files changed

+148
-34
lines changed

4 files changed

+148
-34
lines changed

.github/workflows/zig.yml

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,15 @@
1-
name: Zig
1+
on: [push, pull_request]
22

3-
on:
4-
push:
5-
pull_request:
6-
schedule:
7-
- cron: "0 0 * * *"
3+
name: build
84

95
jobs:
10-
test:
11-
strategy:
12-
matrix:
13-
os: [ubuntu-latest, macos-latest, windows-latest]
14-
runs-on: ${{matrix.os}}
15-
steps:
16-
- uses: actions/checkout@v2
17-
with:
18-
submodules: recursive
19-
- uses: goto-bus-stop/setup-zig@v1
20-
with:
21-
version: master
22-
- run: zig build
23-
- run: zig build test
24-
lint:
6+
zig:
7+
name: Build and test
258
runs-on: ubuntu-latest
269
steps:
27-
- uses: actions/checkout@v2
28-
with:
29-
submodules: recursive
30-
- uses: goto-bus-stop/setup-zig@v1
31-
with:
32-
version: master
33-
- run: zig fmt --check build.zig src/*.zig
10+
- uses: actions/checkout@v3
11+
- name: Install Nix
12+
uses: DeterminateSystems/nix-installer-action@v4
13+
- name: Run the Magic Nix Cache
14+
uses: DeterminateSystems/magic-nix-cache-action@v2
15+
- run: nix flake check -L

flake.lock

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
inputs = {
3+
zig = {
4+
url = github:mitchellh/zig-overlay;
5+
inputs.nixpkgs.follows = "nixpkgs";
6+
inputs.flake-utils.follows = "flake-utils";
7+
};
8+
};
9+
10+
outputs = {
11+
self,
12+
nixpkgs,
13+
flake-utils,
14+
zig,
15+
}:
16+
flake-utils.lib.eachDefaultSystem (system: let
17+
pkgs = nixpkgs.legacyPackages.${system};
18+
inherit (pkgs) lib;
19+
in rec {
20+
packages.default = pkgs.stdenv.mkDerivation {
21+
name = "htmlentities.zig-build";
22+
23+
src = ./.;
24+
25+
nativeBuildInputs = [
26+
zig.packages.${system}."0.12.0"
27+
];
28+
29+
buildPhase = ''
30+
export ZIG_GLOBAL_CACHE_DIR="$TMPDIR/zig"
31+
zig build test
32+
touch $out
33+
'';
34+
35+
dontInstall = true;
36+
};
37+
38+
formatter = pkgs.alejandra;
39+
});
40+
}

zig.mod

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)