[feat] ci: add forgejo actions
This commit is contained in:
parent
89c614818f
commit
693eeee537
5 changed files with 59 additions and 19 deletions
20
.forgejo/workflows/check.yml
Normal file
20
.forgejo/workflows/check.yml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: nixos
|
||||||
|
steps:
|
||||||
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
- run: nix --version
|
||||||
|
- run: nix flake update systems
|
||||||
|
- run: nix flake check --keep-going
|
||||||
|
build:
|
||||||
|
runs-on: nixos
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
machine:
|
||||||
|
- vm
|
||||||
|
steps:
|
||||||
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
- run: nix --version
|
||||||
|
- run: nix flake update systems
|
||||||
|
- run: nix build --print-build-logs '.#nixosConfigurations.${{ matrix.machine }}.config.system.build.toplevel'
|
22
flake.nix
22
flake.nix
|
@ -112,25 +112,9 @@
|
||||||
pkgs = import nixpkgs {inherit system overlays;};
|
pkgs = import nixpkgs {inherit system overlays;};
|
||||||
module = ./nvim/nixvim.nix;
|
module = ./nvim/nixvim.nix;
|
||||||
};
|
};
|
||||||
formatting = pkgs.stdenvNoCC.mkDerivation {
|
fmt = pkgs.callPackage ./fmt.nix {inherit src;};
|
||||||
name = "nix-formatting-check";
|
lint = pkgs.callPackage ./lint.nix {inherit src;};
|
||||||
dontUnpack = true;
|
typos = pkgs.callPackage ./lint.nix {inherit src;};
|
||||||
dontBuild = true;
|
|
||||||
doCheck = true;
|
|
||||||
checkPhase = "${pkgs.lib.getExe self.formatter.${system}} --check --quiet ${src}";
|
|
||||||
installPhase = "mkdir $out";
|
|
||||||
};
|
|
||||||
typos = let
|
|
||||||
typos = pkgs.lib.getExe pkgs.typos;
|
|
||||||
in
|
|
||||||
pkgs.stdenvNoCC.mkDerivation {
|
|
||||||
name = "typos-check";
|
|
||||||
dontUnpack = true;
|
|
||||||
dontBuild = true;
|
|
||||||
doCheck = true;
|
|
||||||
checkPhase = "${typos} --color=always ${src}";
|
|
||||||
installPhase = "mkdir $out";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
12
fmt.nix
Normal file
12
fmt.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenvNoCC,
|
||||||
|
alejandra,
|
||||||
|
src,
|
||||||
|
}:
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
name = "fmt-src";
|
||||||
|
inherit src;
|
||||||
|
buildPhase = "${lib.getExe alejandra} --check .";
|
||||||
|
installPhase = "mkdir $out";
|
||||||
|
}
|
12
lint.nix
Normal file
12
lint.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenvNoCC,
|
||||||
|
statix,
|
||||||
|
src,
|
||||||
|
}:
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
name = "lint-src";
|
||||||
|
inherit src;
|
||||||
|
buildPhase = "${lib.getExe statix} check .";
|
||||||
|
installPhase = "mkdir $out";
|
||||||
|
}
|
12
typos.nix
Normal file
12
typos.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenvNoCC,
|
||||||
|
typos,
|
||||||
|
src,
|
||||||
|
}:
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
name = "typos-src";
|
||||||
|
inherit src;
|
||||||
|
buildPhase = "${lib.getExe typos} .";
|
||||||
|
installPhase = "mkdir $out";
|
||||||
|
}
|
Loading…
Reference in a new issue