From 516129202beab8a11b22e0ae3e7559a3acfb6d26 Mon Sep 17 00:00:00 2001 From: Phoeniix Zhao Date: Wed, 10 Jan 2024 14:50:57 +0800 Subject: [PATCH] ci: use go-version-file to specify the go version Signed-off-by: Phoeniix Zhao --- .github/workflows/ci.yml | 9 +++------ .github/workflows/e2e.yml | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70404396..e6ac3e99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,9 +6,6 @@ on: pull_request: branches: [main] -env: - GO_VERSION: '1.21' - jobs: format: name: Format @@ -20,7 +17,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ${{env.GO_VERSION}} + go-version-file: go.mod - name: Format code uses: iamnotaturtle/auto-gofmt@v2.1.0 @@ -38,7 +35,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ${{env.GO_VERSION}} + go-version-file: go.mod - name: golangci-lint uses: golangci/golangci-lint-action@v3 @@ -55,7 +52,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: ${{env.GO_VERSION}} + go-version-file: go.mod - name: Build and test run: make test diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ebcb5f9f..6a70a270 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -23,8 +23,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version-file: go/src/github.com/${{ github.repository }}/go.mod - go-version: 1.21.3 + go-version-file: go.mod - name: 'E2E CI' run: bash ./tests/e2e/e2e.sh -p ci - name: clean