mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-10 15:49:47 +03:00
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 <brian@bmcgee.ie>
This commit is contained in:
parent
45cc82c105
commit
4cc7e00488
24
.github/workflows/golangci-lint.yml
vendored
Normal file
24
.github/workflows/golangci-lint.yml
vendored
Normal 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
|
36
.github/workflows/nix.yml
vendored
36
.github/workflows/nix.yml
vendored
@ -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 }}"
|
|
21
flake.lock
21
flake.lock
@ -114,26 +114,6 @@
|
|||||||
"type": "github"
|
"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": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714253743,
|
"lastModified": 1714253743,
|
||||||
@ -157,7 +137,6 @@
|
|||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"gomod2nix": "gomod2nix",
|
"gomod2nix": "gomod2nix",
|
||||||
"nix-filter": "nix-filter",
|
"nix-filter": "nix-filter",
|
||||||
"nix-github-actions": "nix-github-actions",
|
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
}
|
}
|
||||||
|
14
flake.nix
14
flake.nix
@ -22,10 +22,6 @@
|
|||||||
};
|
};
|
||||||
flake-compat.url = "github:nix-community/flake-compat";
|
flake-compat.url = "github:nix-community/flake-compat";
|
||||||
nix-filter.url = "github:numtide/nix-filter";
|
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";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
treefmt-nix = {
|
treefmt-nix = {
|
||||||
url = "github:numtide/treefmt-nix";
|
url = "github:numtide/treefmt-nix";
|
||||||
@ -42,15 +38,5 @@
|
|||||||
nixpkgs.config = {
|
nixpkgs.config = {
|
||||||
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) ["terraform"];
|
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;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user