From a6a7ccbc9bdbdc45cd4e7316228d0213cf0d3dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 10 Jan 2023 08:05:45 +0100 Subject: [PATCH] add shellcheck to flake instead --- .github/workflows/test.yml | 18 ------------------ flake.nix | 14 ++++++++++---- 2 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index ba736f2..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -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' diff --git a/flake.nix b/flake.nix index cd22b53..2137583 100644 --- a/flake.nix +++ b/flake.nix @@ -25,14 +25,20 @@ default = self.packages.${system}.disko; }); # TODO: disable bios-related tests on aarch64... + # Run checks: nix flake check -L checks = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; - in - # Run tests: nix flake check -L - import ./tests { + nixosTests = import ./tests { inherit pkgs; makeTest = import (pkgs.path + "/nixos/tests/make-test-python.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; }); }; }