forked from genuinetools/audit
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.32 KB
/
main.yml
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
name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.20.x"
cache: false
- name: Get Go cached paths
run: |
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
- name: Restore dependencies cache
uses: actions/cache@v3
if: ${{ false }}
with:
path: |
${{ env.cache }}
key: setup-go-deps-${{ hashFiles('go.sum go.mod') }}
restore-keys: |
setup-go-deps-
- name: Restore intermediate built files cache
uses: actions/cache@v3
with:
path: |
${{ env.modcache }}
key: setup-go-build-${{ hashFiles('**/*.go') }}
restore-keys: |
setup-go-build-
- name: Cached files stats
run: |
echo 'Cache intermediate built files size (Mb):'
du -m -s ${{ env.cache }}
echo 'Cached dependencies size (Mb):'
du -m -s ${{ env.modcache }}
- name: get
run: |
go get
- name: build
run: |
go build