diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..d6a46c5 --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,28 @@ +name: Nix +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + test: + name: Nix Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v11 + - uses: DeterminateSystems/magic-nix-cache-action@v6 + - uses: DeterminateSystems/flake-checker-action@v7 + with: + ignore-missing-flake-lock: false + fail-mode: true + - name: Build + run: nix build + - name: Check formatting + run: nix develop --command nixfmt --check **.nix + - name: Run Dev Shell Build + run: nix develop --command go build ./... + - name: Run Dev Shell Tests + run: nix develop --command go test ./... + - name: Flake Check + run: nix flake check --all-systems diff --git a/flake.nix b/flake.nix index ccfe9cd..ada444c 100644 --- a/flake.nix +++ b/flake.nix @@ -30,13 +30,14 @@ }; default = pangfiles; }; - devShell = pkgs.mkShell { + devShells.default = pkgs.mkShell { packages = [ pkgs.git pkgs.gopls pkgs.gotools pkgs.go_1_22 pkgs.gnumake + pkgs.nixfmt-rfc-style ] ++ deps; }; }