open-vault/.github/workflows/setup-go-cache.yml

34 lines
1.1 KiB
YAML

on:
workflow_call:
inputs:
runs-on:
required: true
type: string
jobs:
setup-go-cache:
runs-on: ${{ fromJSON(inputs.runs-on) }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- id: setup-go
name: Setup go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: ./.go-version
cache: true
- id: setup-git
name: Setup Git configuration
run: |
git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}@github.com".insteadOf https://github.com
- id: download-modules
name: Download go modules
run: |
# go list ./... forces downloading some additional versions of modules that 'go mod
# download' misses. We need this because we make use of go list itself during
# code generation in later builds that rely on this module cache.
go list ./...
go list -test ./...
go mod download
( cd sdk && go mod download )
( cd api && go mod download )