1
0
Fork 0
mirror of https://github.com/cisagov/log4j-affected-db.git synced 2024-11-22 16:40:48 +00:00

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>
This commit is contained in:
Jeremy Frasier 2021-07-11 21:59:58 -04:00
parent 181d1b2faf
commit bb6e566e3a
No known key found for this signature in database
GPG key ID: 285B4A02F4305C09

View file

@ -23,6 +23,20 @@ jobs:
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.9 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 - uses: actions/cache@v2
env: env:
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\ BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
@ -48,18 +62,6 @@ jobs:
${{ hashFiles('**/.pre-commit-config.yaml') }}" ${{ hashFiles('**/.pre-commit-config.yaml') }}"
restore-keys: | restore-keys: |
${{ env.BASE_CACHE_KEY }} ${{ 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 - name: Setup curl cache
run: mkdir -p ${{ env.CURL_CACHE_DIR }} run: mkdir -p ${{ env.CURL_CACHE_DIR }}
- name: Install Packer - name: Install Packer