-
Notifications
You must be signed in to change notification settings - Fork 205
60 lines (49 loc) · 1.7 KB
/
clean.yml
File metadata and controls
60 lines (49 loc) · 1.7 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
name: Cleanup
on:
schedule:
# run every Saturday
- cron: "0 12 * * 6"
permissions:
contents: read
jobs:
clean:
name: Clean caches
timeout-minutes: 5
continue-on-error: false
runs-on: ubuntu-22.04
env:
GOFLAGS: -v -mod=readonly
steps:
- name: Configure git for private modules
env:
ROBOT_TOKEN: ${{ secrets.ROBOT_TOKEN }}
run: echo "machine github.com login percona-robot password ${{ secrets.ROBOT_TOKEN }}" > $HOME/.netrc
- name: Set up Go
env:
# to avoid error due to `go version` accepting -v flag with an argument since 1.15
GOFLAGS: ""
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: ${{ github.workspace }}/go.mod
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
lfs: true
- name: Enable Go modules cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-modules-
- name: Enable Go build cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ github.ref }}-${{ hashFiles('**') }}
restore-keys: |
${{ runner.os }}-go-build-${{ github.ref }}-
${{ runner.os }}-go-build-
- name: Clean Go modules cache
run: go clean -modcache
- name: Clean Go build cache
run: go clean -cache