-
Notifications
You must be signed in to change notification settings - Fork 74
69 lines (60 loc) · 1.78 KB
/
cleanup.yaml
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
65
66
67
68
69
---
name: Cleanup
on:
schedule:
# Saturday 7:00
- cron: "0 7 * * 6"
jobs:
clean:
name: Clean caches
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
go-version:
- 1.17.x
- tip
runs-on: ${{ matrix.os }}
env:
WORKDIR: "${{ github.workspace }}/gopath/src/gopkg.in/reform.v1"
GOPATH: "${{ github.workspace }}/gopath"
GOBIN: "${{ github.workspace }}/gopath/bin"
GO111MODULE: "on"
GOPROXY: "https://proxy.golang.org"
steps:
# Cache Go modules, build cache, installed packages and GOPATH sources
# to significantly decreases total CI time. See also cleanup.yaml.
- name: Enable Go cache
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
${{ env.GOPATH }}/pkg
${{ env.GOPATH }}/src/github.com
${{ env.GOPATH }}/src/golang.org
key: ${{ matrix.os }}-${{ matrix.go-version }}
- name: Set up Go version ${{ matrix.go-version }}
if: matrix.go-version != 'tip'
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Go tip
if: matrix.go-version == 'tip'
run: |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin" >> $GITHUB_PATH
echo "$GOBIN" >> $GITHUB_PATH
- name: Check out code into GOPATH
uses: actions/checkout@v2
with:
path: ${{ env.WORKDIR }}
- name: Clean Go cache
run: |
go clean -modcache
go clean -cache
rm -fr ${{ env.GOPATH }}