File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- # This workflow will build a golang project
3- # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
4-
52name : Go
63
74on :
8- push :
9- branches : [ "main" ]
105 pull_request :
11- branches : [ "main" ]
6+ push :
7+ branches : [main]
128
139jobs :
14-
1510 build :
1611 runs-on : ubuntu-latest
1712 steps :
1813 - uses : actions/checkout@v6
14+ - name : Load project settings
15+ id : settings
16+ run : |
17+ set -a
18+ source .project-settings.env
19+ set +a
20+ echo "go_version=${GO_VERSION}" >> "$GITHUB_OUTPUT"
21+ echo "gci_prefix=${GCI_PREFIX:-github.com/hyp3rd/hypercache}" >> "$GITHUB_OUTPUT"
22+ echo "golangci_lint_version=${GOLANGCI_LINT_VERSION}" >> "$GITHUB_OUTPUT"
23+ echo "proto_enabled=${PROTO_ENABLED:-true}" >> "$GITHUB_OUTPUT"
1924
2025 - name : Set up Go
21- uses : actions/setup-go@v6
26+ uses : actions/setup-go@v6.1.0
27+ with :
28+ go-version : " ${{ steps.settings.outputs.go_version }}"
29+ check-latest : true
30+
31+ - name : Cache Go modules
32+ uses : actions/cache@v5
2233 with :
23- go-version : ' 1.25'
34+ path : |
35+ ~/go/pkg/mod
36+ ~/.cache/go-build
37+ key : ${{ runner.os }}-go-${{ steps.settings.outputs.go_version }}-${{ hashFiles('**/go.sum') }}
38+ restore-keys : |
39+ ${{ runner.os }}-go-${{ steps.settings.outputs.go_version }}-
40+
41+ - name : Modules download
42+ run : go mod download
43+
44+ - name : Tidy check
45+ run : |
46+ go mod tidy
47+ git diff --exit-code go.mod go.sum
48+
49+ - name : Verify
50+ run : go mod verify
2451
2552 - name : Build
2653 run : go build -v ./...
27-
28- - name : Test
29- run : go test -v ./...
Original file line number Diff line number Diff line change 33 - repo : https://github.com/pre-commit/pre-commit-hooks
44 rev : v6.0.0
55 hooks :
6- - id : check-json
7- - id : pretty-format-json
8- exclude : cspell.json
96 - id : end-of-file-fixer
107 - id : mixed-line-ending
118 - id : trailing-whitespace
@@ -16,20 +13,15 @@ repos:
1613 files : .*\.(yaml|yml)$
1714 exclude : mkdocs.yml
1815 args : [--allow-multiple-documents]
19- - id : requirements-txt-fixer
2016 - repo : https://github.com/adrienverge/yamllint.git
21- rev : v1.37.1
17+ rev : v1.38.0
2218 hooks :
2319 - id : yamllint
2420 files : \.(yaml|yml)$
2521 types : [file, yaml]
2622 entry : yamllint --strict -f parsable
27- - repo : https://github.com/hadolint/hadolint
28- rev : v2.14.0
29- hooks :
30- - id : hadolint-docker
3123 - repo : https://github.com/streetsidesoftware/cspell-cli
32- rev : v9.3.3
24+ rev : v9.4.0
3325 hooks :
3426 # Spell check changed files
3527 - id : cspell
@@ -53,15 +45,3 @@ repos:
5345 entry : mdl
5446 language : ruby
5547 files : \.(md|mdown|markdown)$
56- - repo : local
57- hooks :
58- - id : go-verify
59- name : go-verify
60- language : system
61- entry : ./.pre-commit/go-mod-hook
62- require_serial : true
63- - id : gci
64- name : gci
65- language : system
66- entry : ./.pre-commit/gci-hook
67- require_serial : true
Original file line number Diff line number Diff line change 1919 - id : requirements-txt-fixer
2020 - id : no-commit-to-branch
2121 - repo : https://github.com/adrienverge/yamllint.git
22- rev : v1.37.1
22+ rev : v1.38.0
2323 hooks :
2424 - id : yamllint
2525 files : \.(yaml|yml)$
Original file line number Diff line number Diff line change 1- GOLANGCI_LINT_VERSION = v2.7.2
2- BUF_VERSION = v1.61 .0
1+ GOLANGCI_LINT_VERSION = v2.8.0
2+ BUF_VERSION = v1.63 .0
33GO_VERSION = 1.25.5
44GCI_PREFIX = github.com/hyp3rd/hypercache
55PROTO_ENABLED = true
You can’t perform that action at this time.
0 commit comments