Skip to content

Cleanup

Cleanup #206

Workflow file for this run

---
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 }}