2022-12-15 16:23:13 +08:00
|
|
|
# A resuable workflow that's used to setup the go enviroment and cache.
|
|
|
|
name: Setup go enviroment
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: setup go ${{ env.GO_VERSION }}
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: '${{ env.GO_VERSION }}'
|
|
|
|
|
|
|
|
- name: go cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
# In order:
|
|
|
|
# * Module download cache
|
|
|
|
# * Build cache (Linux)
|
|
|
|
# * Build cache (Mac)
|
|
|
|
# * Build cache (Windows)
|
|
|
|
path: |
|
|
|
|
~/go/pkg/mod
|
|
|
|
~/.cache/go-build
|
|
|
|
~/Library/Caches/go-build
|
|
|
|
~\AppData\Local\go-build
|
|
|
|
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-${{ env.GO_VERSION }}-
|
2023-01-06 08:58:40 +01:00
|
|
|
|
|
|
|
- name: set GOPATH
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
|