Skip to content

Commit a1fd90f

Browse files
committed
Use synergy/harmony to setup tools
1 parent 0b88529 commit a1fd90f

File tree

21 files changed

+358
-387
lines changed

21 files changed

+358
-387
lines changed

.envrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
use flake
1+
#!/usr/bin/env bash
2+
3+
if type -P lorri &>/dev/null; then
4+
eval "$(lorri direnv)"
5+
elif type -v nix &>/dev/null; then
6+
use flake .
7+
else
8+
echo "The shell is set up via Nix, but it seems it is not installed."
9+
echo "Please setup your shell manually following README's instructions."
10+
fi

.github/dependabot.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,3 @@ updates:
1515
interval: "monthly"
1616
day: "saturday"
1717
open-pull-requests-limit: 1
18-
19-
...

.github/workflows/ci.yml

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,73 @@
22

33
name: "CI"
44
on:
5-
workflow_dispatch: {}
65
push:
76
branches: ["main"]
87
pull_request:
98
branches: ["main"]
10-
119
jobs:
12-
tests:
10+
check-quality:
1311
runs-on: "ubuntu-latest"
1412
steps:
15-
- uses: "cachix/install-nix-action@v25"
13+
# setup
14+
- uses: "webfactory/[email protected]"
15+
with:
16+
ssh-private-key: "${{ secrets.SSH_PRIVATE_KEY }}"
17+
- uses: "actions/checkout@v4"
18+
- uses: "DeterminateSystems/nix-installer-action@v16"
1619
with:
17-
nix_path: "nixpkgs=channel:nixpkgs-unstable"
18-
- uses: "actions/checkout@v3"
19-
- name: "Print installed nixpkgs version"
20-
run: "nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'"
20+
diagnostic-endpoint: ""
21+
- uses: "DeterminateSystems/magic-nix-cache-action@v8"
22+
with:
23+
diagnostic-endpoint: ""
2124
- name: "Print flake metadata"
2225
run: "nix flake metadata"
26+
- uses: "DeterminateSystems/flake-checker-action@v9"
27+
with:
28+
fail-mode: true
29+
ignore-missing-flake-lock: false
30+
nixpkgs-keys: "nixpkgs"
31+
send-statistics: false
2332
- name: "Setup shell"
2433
run: "nix develop --command true"
34+
35+
# tests
36+
- name: "Flake check"
37+
run: "nix flake check --all-systems --print-build-logs"
38+
39+
- name: "Files respect Editorconfig configuration"
40+
run: "nix develop --command editorconfig-checker"
41+
42+
- name: "Files respect treefmt format"
43+
run: |
44+
# we need to explicitly add all formatters except cue
45+
# this is due to cue re-generating files, which would cause --fail-on-change to fail.
46+
nix develop --command \
47+
treefmt \
48+
--no-cache --fail-on-change \
49+
--formatters alejandra \
50+
--formatters gci \
51+
--formatters gofumpt \
52+
--formatters goimports \
53+
--formatters jsonfmt \
54+
--formatters mdsh \
55+
--formatters shfmt \
56+
--formatters yamlfmt
57+
2558
- name: "Run go unit tests"
2659
run: "nix develop --command go test -v -race -count=1 ./..."
27-
- name: "Lint nix files"
28-
run: "nix develop --command ./scripts/lint-nix.sh"
29-
- name: "Lint go files"
30-
run: "nix develop --command ./scripts/lint-go.sh"
31-
- name: "Lint shell files"
32-
run: "nix develop --command shellcheck **/*.sh"
33-
- name: "Lint yaml files"
34-
run: "nix develop --command yamllint --config-file .yamllint.yml ."
35-
36-
...
60+
61+
- name: "Lint Github Actions"
62+
run: "nix develop --command lint-ghaction"
63+
64+
- name: "Lint Shell scripts"
65+
run: "nix develop --command lint-sh"
66+
67+
- name: "Lint Yaml configurations files"
68+
run: "nix develop --command lint-yaml"
69+
70+
- name: "Lint Go code"
71+
run: "nix develop --command lint-go"
72+
73+
- name: "Lint Nix code"
74+
run: "nix develop --command lint-nix"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
/.direnv
2+
/result
3+
4+
# nixago: ignore-linked-files
5+
/.editorconfig

.golangci.yml

Lines changed: 0 additions & 184 deletions
This file was deleted.

.yamllint.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)