Bump go to 1.20 #260
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: [master] | |
workflow_dispatch: | |
jobs: | |
dependabot: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
if: github.actor == 'dependabot[bot]' | |
steps: | |
- name: Dependabot metadata | |
id: metadata | |
uses: dependabot/fetch-metadata@v1 | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Enable auto-merge for Dependabot PRs | |
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' | |
run: gh pr merge --auto --merge "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
go_checks: | |
runs-on: ubuntu-latest | |
container: eversc/go-pr-checks:1.19 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: go build | |
run: | | |
export GO111MODULE=on | |
go build | |
- name: go fmt | |
run: | | |
test -z $(/usr/local/go/bin/gofmt -s -l $(find . -iname '*.go' -type f | grep -v /vendor/)) | |
- name: go vet | |
run: | | |
go vet ./... | |
- name: go cyclo | |
run: | | |
gocyclo -over 6 cmd | |
- name: go lint | |
run: | | |
golint -set_exit_status $(go list ./...) | |
- name: go test | |
run: | | |
go test ./... -v | |
docker_build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "=1.19" | |
- name: go build | |
run: | | |
export GO111MODULE=on | |
go build -o cloud-key-rotator ./cmd | |
ls -lah | |
- name: docker build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: false | |
tf_checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: terraform format check | |
id: fmt | |
run: terraform fmt -check -recursive -diff || (echo "::error title=terraform format check failed::Run 'terraform fmt -recursive' to ensure all files are correctly formatted";exit 1) | |
# don't validate AWS terraform as the provider requires a region to be set | |
- name: terraform validate | |
id: validate | |
run: terraform validate -no-color -test-directory=tf_module/ckr_gcp |