Skip to content

Commit 16b81d4

Browse files
fix ci
1 parent 67f2daf commit 16b81d4

File tree

4 files changed

+46
-42
lines changed

4 files changed

+46
-42
lines changed

.editorconfig

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
# https://editorconfig.org
1+
; https://editorconfig.org
22
root = true
33

4-
# default configuration
4+
; default configuration
55
[*]
66
charset = utf-8
77
end_of_line = lf
88
trim_trailing_whitespace = true
99
insert_final_newline = true
10+
indent_style = unset
1011

11-
# tab is problematic for markdown
12-
[*.md]
12+
[{*.nix,flake.lock}]
1313
indent_style = space
1414
indent_size = 2
1515

16-
; yaml require space indentation
1716
[*.{yml,yaml}]
1817
indent_style = space
1918
indent_size = 2
2019

21-
; nixpkgs-fmt compatible
22-
[*.nix,flake.lock]
20+
[*.md]
2321
indent_style = space
2422
indent_size = 2
2523

26-
# gofmt compatible
2724
[*.go,go.mod,go.sum]
2825
indent_style = tab

.github/workflows/main.yaml

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,38 @@ on:
55
push:
66
branches: [main]
77
env:
8-
CI_NIX_STORE: ~/nix
98
CI_NIX_FLAKE: .#default
109
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Setup Nix
16+
uses: DeterminateSystems/nix-installer-action@main
17+
- name: Cache Nix
18+
uses: DeterminateSystems/magic-nix-cache-action@main
19+
- name: Lint
20+
run: |
21+
nix develop ${{ env.CI_NIX_FLAKE }} --command \
22+
editorconfig-checker && echo "ok"
1123
test:
1224
runs-on: ubuntu-latest
1325
steps:
1426
- name: Checkout
15-
uses: actions/checkout@v3
27+
uses: actions/checkout@v4
1628
- name: Setup Nix
17-
uses: cachix/install-nix-action@v20
29+
uses: DeterminateSystems/nix-installer-action@main
1830
- name: Cache Nix
19-
uses: actions/cache@v3
20-
with:
21-
path: ${{ env.CI_NIX_STORE }}
22-
key: ${{ runner.os }}-nix-${{ hashFiles('flake.nix', 'flake.lock') }}
31+
uses: DeterminateSystems/magic-nix-cache-action@main
2332
- name: Cache Go
24-
uses: actions/cache@v3
33+
uses: actions/cache@v4
2534
with:
2635
key: ${{ runner.os }}-go-${{ hashfiles('go.mod', 'go.sum') }}
2736
path: |
2837
~/.cache/go-build
2938
~/go/pkg/mod
3039
- name: Test
3140
run: |
32-
nix --store ${{ env.CI_NIX_STORE }} \
33-
develop ${{ env.CI_NIX_FLAKE }} --command \
41+
nix develop ${{ env.CI_NIX_FLAKE }} --command \
3442
go test -v -cover -race ./...
35-
lint:
36-
runs-on: ubuntu-latest
37-
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v3
40-
- name: Setup Nix
41-
uses: cachix/install-nix-action@v20
42-
- name: Cache Nix
43-
uses: actions/cache@v3
44-
with:
45-
path: ${{ env.CI_NIX_STORE }}
46-
key: ${{ runner.os }}-nix-${{ hashFiles('flake.nix', 'flake.lock') }}
47-
- name: Lint
48-
run: |
49-
nix --store ${{ env.CI_NIX_STORE }} \
50-
develop ${{ env.CI_NIX_FLAKE }} --command \
51-
editorconfig-checker && echo "ok"

.gitignore

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1-
# binaries for programs and plugins
1+
# https://github.com/github/gitignore/blob/main/Go.gitignore
2+
3+
# If you prefer the allow list template instead of the deny list, see community template:
4+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
5+
#
6+
# Binaries for programs and plugins
27
*.exe
38
*.exe~
49
*.dll
510
*.so
611
*.dylib
712

8-
# go test -c
13+
# Test binary, built with `go test -c`
914
*.test
1015

11-
# go test -coverprofile coverage.out
16+
# Output of the go coverage tool, specifically when used with LiteIDE
1217
*.out
1318

14-
# direnv cache folder
15-
.direnv/
19+
# Dependency directories (remove the comment below to include it)
20+
# vendor/
21+
22+
# Go workspace file
23+
go.work
24+
go.work.sum
1625

17-
# macOS
18-
.DS_Store
26+
# env file
27+
.env

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
nixpkgs/update:
2+
@nix flake lock --override-input nixpkgs github:NixOS/nixpkgs/$(rev)
3+
4+
.PHONY: build test run clean
5+
6+
test:
7+
@go test -cover ./...

0 commit comments

Comments
 (0)