add shellcheck to flake instead

This commit is contained in:
Jörg Thalheim 2023-01-10 08:05:45 +01:00
parent 5a4d706e52
commit a6a7ccbc9b
2 changed files with 10 additions and 22 deletions

View file

@ -1,18 +0,0 @@
name: test
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3.2.0
- name: Install Nix
uses: cachix/install-nix-action@v18
with:
extra_nix_config: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: ShellCheck
run: nix-shell --packages git shellcheck --pure --run 'shellcheck disk-deactivate/disk-deactivate disko'

View file

@ -25,14 +25,20 @@
default = self.packages.${system}.disko; default = self.packages.${system}.disko;
}); });
# TODO: disable bios-related tests on aarch64... # TODO: disable bios-related tests on aarch64...
# Run checks: nix flake check -L
checks = forAllSystems (system: let checks = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in nixosTests = import ./tests {
# Run tests: nix flake check -L
import ./tests {
inherit pkgs; inherit pkgs;
makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix"); makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix");
eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix"); eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix");
}); };
shellcheck = pkgs.runCommand "shellcheck" { nativeBuildInputs = [ pkgs.shellcheck ]; } ''
cd ${./.}
shellcheck disk-deactivate/disk-deactivate disko
touch $out
'';
in
nixosTests // { inherit shellcheck; });
}; };
} }