refine github workflows (#331)
Some checks failed
gh-pages / build (push) Has been cancelled
golangci-lint / lint (push) Has been cancelled
gh-pages / deploy (push) Has been cancelled

* 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 <brian@bmcgee.ie>
This commit is contained in:
Brian McGee 2024-07-03 19:14:42 +01:00 committed by GitHub
parent 45cc82c105
commit 4cc7e00488
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 71 deletions

24
.github/workflows/golangci-lint.yml vendored Normal file
View File

@ -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

View File

@ -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 }}"

View File

@ -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"
}

View File

@ -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;
};
};
}