Skip to content

Commit f6e2186

Browse files
committed
Added linting and caching of dependencies
1 parent bf2f25a commit f6e2186

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/workflow.yml

+34
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,36 @@ jobs:
1717
uses: actions/setup-go@v5
1818
with:
1919
go-version: 1.22.4
20+
- name: Cache Go modules
21+
uses: actions/cache@v3
22+
with:
23+
path: ~/go/pkg/mod
24+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
25+
restore-keys: |
26+
${{ runner.os }}-go-
2027
- name: Build
2128
run: go build -v ./...
2229

30+
lint:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Set up Go
35+
uses: actions/setup-go@v5
36+
with:
37+
go-version: 1.22.4
38+
- name: Cache Go modules
39+
uses: actions/cache@v3
40+
with:
41+
path: ~/go/pkg/mod
42+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
43+
restore-keys: |
44+
${{ runner.os }}-go-
45+
- name: Lint
46+
uses: golangci/golangci-lint-action@v3
47+
with:
48+
version: latest
49+
2350
test:
2451
runs-on: ubuntu-latest
2552
services:
@@ -43,6 +70,13 @@ jobs:
4370
uses: actions/setup-go@v5
4471
with:
4572
go-version: 1.22.4
73+
- name: Cache Go modules
74+
uses: actions/cache@v3
75+
with:
76+
path: ~/go/pkg/mod
77+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
78+
restore-keys: |
79+
${{ runner.os }}-go-
4680
- name: Install golang-migrate
4781
run: go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
4882
- name: Run Migrations

0 commit comments

Comments
 (0)