-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.74 KB
/
Copy pathcopilot-setup-steps.yml
File metadata and controls
64 lines (53 loc) · 1.74 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
52
53
54
55
56
57
58
59
60
61
62
63
64
name: "Copilot Setup Steps"
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
permissions:
contents: read
packages: read
jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: false
- name: Checksum
id: checksum
run: |
checksum=$(
{
sha256sum go.mod go.sum tools/go.mod tools/go.sum
find . -type f -name "*.go" -print0 | sort -z | xargs -0 sha256sum
} | sha256sum | awk '{print $1}'
)
echo "checksum=$checksum" >> "$GITHUB_OUTPUT"
- name: Cache Go module cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/go/pkg/mod
key: copilot-go-mod-${{ hashFiles('go.sum', 'tools/go.sum') }}
- name: Cache Go build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/go-build
key: copilot-go-build-${{ steps.checksum.outputs.checksum }}
restore-keys: |
copilot-go-build-
- name: Download Go module dependencies
run: |
go mod download
go mod download -modfile tools/go.mod
- name: Install golangci-lint
run: make install/lint
- name: Warm up govulncheck
run: go tool -modfile tools/go.mod govulncheck -version