packer/.github/workflows/go-validate.yml
Wilken Rivera d7dca51108
Update Packer to use Go 1.18 (#11927)
This change updates Packer core Go version to 1.18. The move to Go 1.18 and not Go 1.19
is to allow the HCP Packer SDK time to upgrade to Go 1.18.

Changes Made:
* Bump go mod file to use Go 1.18
* Bump release pipeline to use Go 1.18
* Update plugin updater script to run go mod tidy for Go 1.18
* Update Linux job to use setup-go action
2022-08-18 09:41:29 -04:00

53 lines
1.1 KiB
YAML

#
# This GitHub action runs basic linting checks for Packer.
#
name: "Go Validate"
on: [ workflow_dispatch, push ]
permissions:
contents: read
jobs:
check-mod-tidy:
runs-on: ubuntu-latest
name: Go Mod Tidy
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- run: go mod tidy
check-lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- run: echo "$GITHUB_SHA"
- run: git fetch --all
- run: echo $(git merge-base origin/main $GITHUB_SHA)
- run: make ci-lint
check-fmt:
runs-on: ubuntu-latest
name: Fmt check
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- run: make fmt-check
check-generate:
runs-on: ubuntu-latest
name: Generate check
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- run: make generate-check