From 86255ca5ac9c7fa175b58b926565b11f20f8dab8 Mon Sep 17 00:00:00 2001 From: Axel Christ Date: Mon, 27 Mar 2023 17:29:18 +0200 Subject: [PATCH] Use go-version-file in `setup-go` --- .github/workflows/check-codegen.yml | 32 ++++++++++++++--------------- .github/workflows/golangci-lint.yml | 20 +++++++++--------- .github/workflows/test.yml | 14 ++++++------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/check-codegen.yml b/.github/workflows/check-codegen.yml index b44f19a20..3d1712a28 100644 --- a/.github/workflows/check-codegen.yml +++ b/.github/workflows/check-codegen.yml @@ -3,24 +3,24 @@ name: Check Codegen on: pull_request: paths-ignore: - - 'docs/**' - - '**/*.md' + - 'docs/**' + - '**/*.md' jobs: check-codegen: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - name: Run make generate - run: make generate - - name: Compare the expected and actual generated/* directories - run: | - if [ "$(git diff --ignore-space-at-eol client-go/ | wc -l)" -gt "0" ]; then - echo "Detected uncommitted changes after build. Consider running 'make generate'." - echo "See status below:" - git diff - exit 1 - fi + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + - name: Run make generate + run: make generate + - name: Compare the expected and actual generated/* directories + run: | + if [ "$(git diff --ignore-space-at-eol client-go/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. Consider running 'make generate'." + echo "See status below:" + git diff + exit 1 + fi diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 7f1874499..3aa13074a 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -3,18 +3,18 @@ name: Lint Golang Codebase on: pull_request: paths-ignore: - - 'docs/**' - - '**/*.md' + - 'docs/**' + - '**/*.md' jobs: golangci: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.51.1 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.51.1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 851cd8756..73aabb130 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,16 +4,16 @@ on: pull_request: types: [ assigned, opened, synchronize, reopened ] paths-ignore: - - 'docs/**' - - '**/*.md' + - 'docs/**' + - '**/*.md' jobs: checks: name: run runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - run: make test + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + - run: make test