From 94c53c533445a8545f00d5345f43fd8a49e35521 Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Wed, 6 Nov 2024 08:14:17 +0000 Subject: [PATCH] ci: run golangci-lint as a flake check instead of github workflow Signed-off-by: Brian McGee --- .github/workflows/golangci-lint.yml | 24 ------------------------ nix/packages/docs.nix | 6 +++++- nix/packages/treefmt/default.nix | 13 +++++++++++++ 3 files changed, 18 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/golangci-lint.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml deleted file mode 100644 index 0eac7f5b..00000000 --- a/.github/workflows/golangci-lint.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: golangci-lint - -on: - push: - tags: - - v* - branches: - - main - pull_request: - -permissions: - contents: read - -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: golangci-lint - uses: golangci/golangci-lint-action@v6 - with: - version: v1.61.0 - args: --timeout=2m diff --git a/nix/packages/docs.nix b/nix/packages/docs.nix index 441b171f..4071574c 100644 --- a/nix/packages/docs.nix +++ b/nix/packages/docs.nix @@ -1,4 +1,8 @@ -{ pkgs, perSystem, ... }: +{ + pkgs, + perSystem, + ... +}: pkgs.stdenvNoCC.mkDerivation { name = "docs"; diff --git a/nix/packages/treefmt/default.nix b/nix/packages/treefmt/default.nix index 22dd6155..7f6a8d0b 100644 --- a/nix/packages/treefmt/default.nix +++ b/nix/packages/treefmt/default.nix @@ -63,6 +63,19 @@ in git config --global user.name "Treefmt Test" ''; + passthru.tests = { + golangci-lint = perSystem.self.treefmt.overrideAttrs (old: { + nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.golangci-lint]; + buildPhase = '' + HOME=$TMPDIR + golangci-lint run + ''; + installPhase = '' + touch $out + ''; + }); + }; + meta = with lib; { description = "treefmt: one CLI to format your repo"; homepage = "https://github.com/numtide/treefmt";