-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.17 KB
/
Copy pathgo.yml
File metadata and controls
51 lines (44 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: CI
on:
push:
branches: ["main", "devel"]
paths: &paths
- 'go.mod'
- '**.go'
- '**.yml'
- '**.yaml'
pull_request:
branches: ["main", "devel"]
paths: *paths
# Best Practice: Restrict global permissions to minimum required (Read-Only)
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
# Disable credential persisting for enhanced security
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true # Enable build caching for faster test execution
- name: Run Tests
run: go test -v ./...
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: false # golangci-lint-action handles its own caching
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
# Use 'latest' to prevent version mismatch with go.mod
version: latest