Skip to content

Commit dbb9f29

Browse files
committed
fix: update build workflow for improved caching and dependency management
1 parent 241513b commit dbb9f29

File tree

3 files changed

+37
-11
lines changed

3 files changed

+37
-11
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,50 @@ name: Build
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: ["*"]
66
pull_request:
7-
branches: [ "main","*" ]
7+
branches: ["*"]
88

99
jobs:
10-
1110
build-go:
1211
runs-on: ubuntu-latest
1312
steps:
14-
- uses: actions/checkout@v4
13+
- name: Checkout code
14+
uses: actions/checkout@v4
1515

1616
- name: Set up Go
1717
uses: actions/setup-go@v4
1818
with:
19-
go-version: '1.24'
19+
go-version: "1.24"
20+
check-latest: true
21+
22+
- name: Cache Go modules
23+
uses: actions/cache@v4
24+
with:
25+
path: |
26+
~/.cache/go-build
27+
~/go/pkg/mod
28+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
31+
32+
- name: Download dependencies
33+
run: go mod download
34+
35+
- name: Verify dependencies
36+
run: go mod verify
37+
38+
- name: Run go vet
39+
run: go vet ./...
40+
41+
- name: Run static analysis (golangci-lint)
42+
uses: golangci/golangci-lint-action@v6
43+
with:
44+
version: latest
45+
args: --timeout=5m
2046

2147
- name: Build
2248
run: go build -v ./...
2349

24-
- name: Test
25-
run: go test -v ./...
50+
- name: Run tests
51+
run: go test -v -race ./...

cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ var (
1818
)
1919

2020
var rootCmd = &cobra.Command{
21-
Use: "pulse-bridge",
22-
Short: "pulse-bridge is a powerful uptime monitoring tool",
23-
Long: `pulse-bridge exposes internal service status via HTTP, enabling seamless integration with external monitoring tools like Atlassian Statuspage.`,
21+
Use: "pulse-bridge",
22+
Short: "pulse-bridge is a powerful uptime monitoring tool",
23+
Long: `pulse-bridge exposes internal service status via HTTP, enabling seamless integration with external monitoring tools like Atlassian Statuspage.`,
2424
RunE: func(cmd *cobra.Command, args []string) error {
2525
versionFlag, _ := cmd.Flags().GetBool("version")
2626
if versionFlag {

internal/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
var (
1111
version string
12-
tag string
12+
tag string
1313
commit string
1414
dirty bool
1515
)

0 commit comments

Comments
 (0)