From 67a267830e85e144f29d8bf3a9d84645b4003f53 Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Fri, 5 Apr 2024 09:55:20 +0200 Subject: [PATCH] Adopt the .go-version approach for toolchain versioning Signed-off-by: Chun-Hung Tseng --- .github/workflows/failpoint_test.yaml | 4 +++- .github/workflows/tests.yaml | 12 +++++++++--- .go-version | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 .go-version diff --git a/.github/workflows/failpoint_test.yaml b/.github/workflows/failpoint_test.yaml index 37f36819b..944ab6b00 100644 --- a/.github/workflows/failpoint_test.yaml +++ b/.github/workflows/failpoint_test.yaml @@ -9,9 +9,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v3 with: - go-version: "1.17.13" + go-version: ${{ steps.goversion.outputs.goversion }} - run: | make gofail-enable make test-failpoint diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 30eed1c74..a756439f1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,9 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v3 with: - go-version: "1.17.13" + go-version: ${{ steps.goversion.outputs.goversion }} - run: make fmt - env: TARGET: ${{ matrix.target }} @@ -64,9 +66,11 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v3 with: - go-version: "1.17.13" + go-version: ${{ steps.goversion.outputs.goversion }} - run: make fmt - env: TARGET: ${{ matrix.target }} @@ -92,8 +96,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v3 with: - go-version: "1.17.13" + go-version: ${{ steps.goversion.outputs.goversion }} - run: make coverage diff --git a/.go-version b/.go-version new file mode 100644 index 000000000..47287f173 --- /dev/null +++ b/.go-version @@ -0,0 +1 @@ +1.17.13