Skip to content

Commit 8ca2b1e

Browse files
authored
Merge pull request #17 from kefniark/chore/lint
Enforce golangci-lint and lint project
2 parents c5a7b57 + bdc30b9 commit 8ca2b1e

51 files changed

Lines changed: 3035 additions & 1712 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pull-request.yaml

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@ on:
66
pull_request:
77
branches: [master]
88

9+
permissions:
10+
contents: read
11+
actions: read
12+
pull-requests: write
13+
914
jobs:
1015
test:
16+
name: "Code Testing"
1117
runs-on: ubuntu-latest
1218
steps:
1319
- uses: actions/checkout@v4
20+
- name: Setup Go 1.23
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.23.0'
1424
- uses: cachix/install-nix-action@v27
1525
with:
1626
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -20,5 +30,46 @@ jobs:
2030
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
2131
- name: Install devenv.sh
2232
run: nix profile install nixpkgs#devenv
23-
- name: Build the devenv shell and run any pre-commit hooks
24-
run: devenv test
33+
- name: Build the devenv shell and run test
34+
run: devenv test
35+
- name: Archive code coverage results
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: "code-coverage"
39+
path: "coverage.txt"
40+
41+
lint:
42+
name: "Code Linting"
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Setup Go 1.23
47+
uses: actions/setup-go@v5
48+
with:
49+
go-version: '1.23.0'
50+
- uses: cachix/install-nix-action@v27
51+
with:
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
- uses: cachix/cachix-action@v15
54+
with:
55+
name: mangosql
56+
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
57+
- name: Install devenv.sh
58+
run: nix profile install nixpkgs#devenv
59+
- name: Run Lint
60+
shell: devenv shell bash -- -e {0}
61+
run: |
62+
just generate
63+
just lint
64+
65+
code_coverage:
66+
name: "Code coverage report"
67+
if: github.event_name == 'pull_request'
68+
runs-on: ubuntu-latest
69+
needs: test
70+
steps:
71+
- uses: fgrosse/go-coverage-report@v1.1.1
72+
continue-on-error: true
73+
with:
74+
coverage-artifact-name: "code-coverage"
75+
coverage-file-name: "coverage.txt"

0 commit comments

Comments
 (0)