From 746f3c5557eeaeb6afd545985c33e722e63a8572 Mon Sep 17 00:00:00 2001 From: Yi Hu Date: Mon, 8 Jul 2024 15:20:17 -0400 Subject: [PATCH] Use go 1.22 for self-hosted GHAs (#31767) * Switch to use setup-environment-action instead of setup-go directly --- .../setup-environment-action/action.yml | 6 ++++-- .github/workflows/go_tests.yml | 7 +++---- .github/workflows/local_env_tests.yml | 18 ++++++++---------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/actions/setup-environment-action/action.yml b/.github/actions/setup-environment-action/action.yml index 912aca0e16f9..3df93cc1135f 100644 --- a/.github/actions/setup-environment-action/action.yml +++ b/.github/actions/setup-environment-action/action.yml @@ -55,6 +55,8 @@ runs: cache-read-only: ${{ inputs.disable-cache }} - name: Install Go if: ${{ inputs.go-version != '' }} - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ inputs.go-version == 'default' && '1.21' || inputs.go-version }} # never set patch, to get latest patch releases. + go-version: ${{ inputs.go-version == 'default' && '1.22' || inputs.go-version }} # never set patch, to get latest patch releases. + cache-dependency-path: | + sdks/go.sum diff --git a/.github/workflows/go_tests.yml b/.github/workflows/go_tests.yml index db30bac68ec4..6818e92bc677 100644 --- a/.github/workflows/go_tests.yml +++ b/.github/workflows/go_tests.yml @@ -43,11 +43,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 2 - - uses: actions/setup-go@v5 + - name: Setup environment + uses: ./.github/actions/setup-environment-action with: - go-version: '1.22' - cache-dependency-path: | - sdks/go.sum + go-version: default - name: Delete old coverage run: "cd sdks && rm -rf .coverage.txt || :" - name: Run coverage diff --git a/.github/workflows/local_env_tests.yml b/.github/workflows/local_env_tests.yml index adfef66b8591..ae2f159710d9 100644 --- a/.github/workflows/local_env_tests.yml +++ b/.github/workflows/local_env_tests.yml @@ -46,12 +46,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - name: Setup environment + uses: ./.github/actions/setup-environment-action with: - go-version: '1.22' - - uses: actions/setup-python@v5 - with: - python-version: '3.8' + go-version: default + python-version: default - name: "Installing local env dependencies" run: "sudo ./local-env-setup.sh" id: local_env_install_ubuntu @@ -64,12 +63,11 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: '1.22' - - uses: actions/setup-python@v5 + - name: Setup environment + uses: ./.github/actions/setup-environment-action with: - python-version: '3.8' + go-version: default + python-version: default - name: "Installing local env dependencies" run: "./local-env-setup.sh" id: local_env_install_mac