From 4cc7e00488cd328ef50770b03ad0ffa4e277cbec Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Wed, 3 Jul 2024 19:14:42 +0100 Subject: [PATCH] refine github workflows (#331) * ci: add golangci-lint workflow It doesn't conform to the treefmt spec so we run it here to catch any issues. * ci: switch to buildbot --------- Signed-off-by: Brian McGee --- .github/workflows/golangci-lint.yml | 24 +++++++++++++++++++ .github/workflows/nix.yml | 36 ----------------------------- flake.lock | 21 ----------------- flake.nix | 14 ----------- 4 files changed, 24 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml delete mode 100644 .github/workflows/nix.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..e76f51f --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,24 @@ +name: golangci-lint + +on: + push: + tags: + - v* + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.57.2 + args: --timeout=2m diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml deleted file mode 100644 index ed3e20f..0000000 --- a/.github/workflows/nix.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Nix Flake Actions -on: - push: - branches: - - main - pull_request: - workflow_dispatch: - -jobs: - nix-matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@V27 - - id: set-matrix - name: Generate Nix Matrix - run: | - set -Eeu - matrix="$(nix eval --json '.#githubActions.matrix')" - echo "matrix=$matrix" >> "$GITHUB_OUTPUT" - - nix-build: - needs: nix-matrix - runs-on: ${{ matrix.os }} - strategy: - matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} - steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@V27 - - uses: cachix/cachix-action@v15 - with: - name: numtide - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - - run: nix build -L ".#${{ matrix.attr }}" diff --git a/flake.lock b/flake.lock index 31d8a4d..c8dc145 100644 --- a/flake.lock +++ b/flake.lock @@ -114,26 +114,6 @@ "type": "github" } }, - "nix-github-actions": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1703863825, - "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", - "owner": "nix-community", - "repo": "nix-github-actions", - "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nix-github-actions", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1714253743, @@ -157,7 +137,6 @@ "flake-compat": "flake-compat", "gomod2nix": "gomod2nix", "nix-filter": "nix-filter", - "nix-github-actions": "nix-github-actions", "nixpkgs": "nixpkgs", "treefmt-nix": "treefmt-nix" } diff --git a/flake.nix b/flake.nix index dc54810..e6d20de 100644 --- a/flake.nix +++ b/flake.nix @@ -22,10 +22,6 @@ }; flake-compat.url = "github:nix-community/flake-compat"; nix-filter.url = "github:numtide/nix-filter"; - nix-github-actions = { - url = "github:nix-community/nix-github-actions"; - inputs.nixpkgs.follows = "nixpkgs"; - }; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; treefmt-nix = { url = "github:numtide/treefmt-nix"; @@ -42,15 +38,5 @@ nixpkgs.config = { allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) ["terraform"]; }; - } - // { - githubActions = inputs.nix-github-actions.lib.mkGithubMatrix { - checks = - lib.getAttrs [ - "x86_64-linux" - "x86_64-darwin" - ] - inputs.self.checks; - }; }; }