mirror of
https://github.com/cisagov/log4j-affected-db.git
synced 2024-11-23 00:50:48 +00:00
Merge pull request #92 from cisagov/improvement/use_action_outputs
Use Outputs of cisagov/setup-env-github-action to Control Installed Program Versions
This commit is contained in:
commit
ee39ac57e3
1 changed files with 21 additions and 14 deletions
35
.github/workflows/build.yml
vendored
35
.github/workflows/build.yml
vendored
|
@ -17,22 +17,23 @@ jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: cisagov/setup-env-github-action@develop
|
- id: setup-env
|
||||||
|
uses: cisagov/setup-env-github-action@develop
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- id: setup-python
|
- id: setup-python
|
||||||
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
|
# We need the Go version and Go cache location for the actions/cache step,
|
||||||
# installation must happen before that.
|
# so the Go installation must happen before that.
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '1.16'
|
go-version: '1.16'
|
||||||
- name: Store installed Go version
|
- name: Store installed Go version
|
||||||
|
id: go-version
|
||||||
run: |
|
run: |
|
||||||
echo "GO_VERSION="\
|
echo "::set-output name=version::"\
|
||||||
"$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')" \
|
"$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')"
|
||||||
>> $GITHUB_ENV
|
|
||||||
- name: Lookup Go cache directory
|
- name: Lookup Go cache directory
|
||||||
id: go-cache
|
id: go-cache
|
||||||
run: |
|
run: |
|
||||||
|
@ -41,9 +42,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
|
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
|
||||||
py${{ steps.setup-python.outputs.python-version }}-\
|
py${{ steps.setup-python.outputs.python-version }}-\
|
||||||
go${{ env.GO_VERSION }}-\
|
go${{ steps.go-version.outputs.version }}-\
|
||||||
packer${{ env.PACKER_VERSION }}-\
|
packer${{ steps.setup-env.outputs.packer-version }}-\
|
||||||
tf${{ env.TERRAFORM_VERSION }}-"
|
tf${{ steps.setup-env.outputs.terraform-version }}-"
|
||||||
with:
|
with:
|
||||||
# Note that the .terraform directory IS NOT included in the
|
# Note that the .terraform directory IS NOT included in the
|
||||||
# cache because if we were caching, then we would need to use
|
# cache because if we were caching, then we would need to use
|
||||||
|
@ -65,6 +66,8 @@ jobs:
|
||||||
- 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
|
||||||
|
env:
|
||||||
|
PACKER_VERSION: ${{ steps.setup-env.outputs.packer-version }}
|
||||||
run: |
|
run: |
|
||||||
PACKER_ZIP="packer_${PACKER_VERSION}_linux_amd64.zip"
|
PACKER_ZIP="packer_${PACKER_VERSION}_linux_amd64.zip"
|
||||||
curl --output ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
|
curl --output ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
|
||||||
|
@ -77,13 +80,17 @@ jobs:
|
||||||
sudo ln -s /opt/packer/packer /usr/local/bin/packer
|
sudo ln -s /opt/packer/packer /usr/local/bin/packer
|
||||||
- uses: hashicorp/setup-terraform@v1
|
- uses: hashicorp/setup-terraform@v1
|
||||||
with:
|
with:
|
||||||
terraform_version: ${{ env.TERRAFORM_VERSION }}
|
terraform_version: ${{ steps.setup-env.outputs.terraform-version }}
|
||||||
- name: Install shfmt
|
- name: Install shfmt
|
||||||
run: go install mvdan.cc/sh/v3/cmd/shfmt@${SHFMT_VERSION}
|
env:
|
||||||
|
PACKAGE_URL: mvdan.cc/sh/v3/cmd/shfmt
|
||||||
|
PACKAGE_VERSION: ${{ steps.setup-env.outputs.shfmt-version }}
|
||||||
|
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
|
||||||
- name: Install Terraform-docs
|
- name: Install Terraform-docs
|
||||||
run: |
|
env:
|
||||||
go install \
|
PACKAGE_URL: github.com/terraform-docs/terraform-docs
|
||||||
github.com/terraform-docs/terraform-docs@${TERRAFORM_DOCS_VERSION}
|
PACKAGE_VERSION: ${{ steps.setup-env.outputs.terraform-docs-version }}
|
||||||
|
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
|
|
Loading…
Reference in a new issue