add nixbased build ci
This commit is contained in:
parent
fc32b56a2f
commit
986e8c8334
13
.gitea/workflows/nix-check.yaml
Normal file
13
.gitea/workflows/nix-check.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
name: Verify build
|
||||
run-name: ${{ gitea.actor }} is building
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
verify_build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v30
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-24.11
|
||||
- run: nix-build
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
/a.out
|
||||
/.zig-cache/
|
||||
/zig-out/
|
||||
/result
|
||||
|
||||
33
default.nix
Normal file
33
default.nix
Normal file
@ -0,0 +1,33 @@
|
||||
# default.nix
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
pname = "RatChess";
|
||||
version = "0.0.1";
|
||||
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
zig
|
||||
zls
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
echo "Building project..."
|
||||
${pkgs.zig}/bin/zig build --global-cache-dir ./cache --release=fast
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp -r zig-out/* $out/
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
echo "Testing project..."
|
||||
${pkgs.zig}/bin/zig build test --global-cache-dir ./cache
|
||||
'';
|
||||
doCheck = true;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user