Move go installation so that it takes place before the cache task

Some variables defined in the go installation are used in the cache
task, so the go installation must happen first.

Co-authored-by: Nick M. <50747025+mcdonnnj@users.noreply.github.com>
pull/113/head
Jeremy Frasier 3 years ago
parent 181d1b2faf
commit bb6e566e3a
No known key found for this signature in database
GPG Key ID: 285B4A02F4305C09
  1. 26
      .github/workflows/build.yml

@ -23,6 +23,20 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.9
# GO_VERSION and GOCACHE are used by the cache task, so the go
# installation must happen before that.
- uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Store installed Go version
run: |
echo "GO_VERSION="\
"$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')" \
>> $GITHUB_ENV
- name: Lookup go cache directory
id: go-cache
run: |
echo "::set-output name=dir::$(go env GOCACHE)"
- uses: actions/cache@v2
env:
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
@ -48,18 +62,6 @@ jobs:
${{ hashFiles('**/.pre-commit-config.yaml') }}"
restore-keys: |
${{ env.BASE_CACHE_KEY }}
- uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Store installed Go version
run: |
echo "GO_VERSION="\
"$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')" \
>> $GITHUB_ENV
- name: Lookup go cache directory
id: go-cache
run: |
echo "::set-output name=dir::$(go env GOCACHE)"
- name: Setup curl cache
run: mkdir -p ${{ env.CURL_CACHE_DIR }}
- name: Install Packer

Loading…
Cancel
Save