@@ -17,22 +17,23 @@ jobs:
17
17
lint :
18
18
runs-on : ubuntu-latest
19
19
steps :
20
- - uses : cisagov/setup-env-github-action@develop
20
+ - id : setup-env
21
+ uses : cisagov/setup-env-github-action@develop
21
22
- uses : actions/checkout@v2
22
23
- id : setup-python
23
24
uses : actions/setup-python@v2
24
25
with :
25
26
python-version : 3.9
26
- # GO_VERSION and GOCACHE are used by the cache task, so the Go
27
- # installation must happen before that.
27
+ # We need the Go version and Go cache location for the actions/cache step,
28
+ # so the Go installation must happen before that.
28
29
- uses : actions/setup-go@v2
29
30
with :
30
31
go-version : ' 1.16'
31
32
- name : Store installed Go version
33
+ id : go-version
32
34
run : |
33
- echo "GO_VERSION="\
34
- "$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')" \
35
- >> $GITHUB_ENV
35
+ echo "::set-output name=version::"\
36
+ "$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')"
36
37
- name : Lookup Go cache directory
37
38
id : go-cache
38
39
run : |
41
42
env :
42
43
BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
43
44
py${{ steps.setup-python.outputs.python-version }}-\
44
- go${{ env.GO_VERSION }}-\
45
- packer${{ env.PACKER_VERSION }}-\
46
- tf${{ env.TERRAFORM_VERSION }}-"
45
+ go${{ steps.go-version.outputs.version }}-\
46
+ packer${{ steps.setup- env.outputs.packer-version }}-\
47
+ tf${{ steps.setup- env.outputs.terraform-version }}-"
47
48
with :
48
49
# Note that the .terraform directory IS NOT included in the
49
50
# cache because if we were caching, then we would need to use
65
66
- name : Setup curl cache
66
67
run : mkdir -p ${{ env.CURL_CACHE_DIR }}
67
68
- name : Install Packer
69
+ env :
70
+ PACKER_VERSION : ${{ steps.setup-env.outputs.packer-version }}
68
71
run : |
69
72
PACKER_ZIP="packer_${PACKER_VERSION}_linux_amd64.zip"
70
73
curl --output ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
@@ -77,13 +80,17 @@ jobs:
77
80
sudo ln -s /opt/packer/packer /usr/local/bin/packer
78
81
- uses : hashicorp/setup-terraform@v1
79
82
with :
80
- terraform_version : ${{ env.TERRAFORM_VERSION }}
83
+ terraform_version : ${{ steps.setup- env.outputs.terraform-version }}
81
84
- name : Install shfmt
82
- run : go install mvdan.cc/sh/v3/cmd/shfmt@${SHFMT_VERSION}
85
+ env :
86
+ PACKAGE_URL : mvdan.cc/sh/v3/cmd/shfmt
87
+ PACKAGE_VERSION : ${{ steps.setup-env.outputs.shfmt-version }}
88
+ run : go install ${PACKAGE_URL}@${PACKAGE_VERSION}
83
89
- name : Install Terraform-docs
84
- run : |
85
- go install \
86
- github.com/terraform-docs/terraform-docs@${TERRAFORM_DOCS_VERSION}
90
+ env :
91
+ PACKAGE_URL : github.com/terraform-docs/terraform-docs
92
+ PACKAGE_VERSION : ${{ steps.setup-env.outputs.terraform-docs-version }}
93
+ run : go install ${PACKAGE_URL}@${PACKAGE_VERSION}
87
94
- name : Install dependencies
88
95
run : |
89
96
python -m pip install --upgrade pip
0 commit comments