From b5f07c9b7d7c799bcaeda692a0d2944ea9b876c9 Mon Sep 17 00:00:00 2001 From: James Blair Date: Fri, 16 Jun 2023 20:37:38 +1200 Subject: [PATCH] Backport .github/workflows: Read .go-version as a step and not separate workflow. Signed-off-by: James Blair --- .github/workflows/e2e.yaml | 7 +++---- .github/workflows/functional.yaml | 7 +++---- .github/workflows/go-version.yaml | 21 --------------------- .github/workflows/grpcproxy.yaml | 7 +++---- .github/workflows/release.yaml | 7 +++---- .github/workflows/tests.yaml | 7 +++---- 6 files changed, 15 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/go-version.yaml diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 1f5be58c509..09acf0adedd 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -1,11 +1,8 @@ name: E2E on: [push, pull_request] jobs: - goversion: - uses: ./.github/workflows/go-version.yaml test: runs-on: ubuntu-latest - needs: goversion strategy: fail-fast: true matrix: @@ -14,9 +11,11 @@ jobs: - linux-386-e2e steps: - uses: actions/checkout@v2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v2 with: - go-version: ${{ needs.goversion.outputs.goversion }} + go-version: ${{ steps.goversion.outputs.goversion }} - run: date - env: TARGET: ${{ matrix.target }} diff --git a/.github/workflows/functional.yaml b/.github/workflows/functional.yaml index bd1ae1a95eb..176f90aa78b 100644 --- a/.github/workflows/functional.yaml +++ b/.github/workflows/functional.yaml @@ -1,11 +1,8 @@ name: functional-tests on: [push, pull_request] jobs: - goversion: - uses: ./.github/workflows/go-version.yaml test: runs-on: ubuntu-latest - needs: goversion strategy: fail-fast: true matrix: @@ -13,9 +10,11 @@ jobs: - linux-amd64-functional steps: - uses: actions/checkout@v2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v2 with: - go-version: ${{ needs.goversion.outputs.goversion }} + go-version: ${{ steps.goversion.outputs.goversion }} - run: date - env: TARGET: ${{ matrix.target }} diff --git a/.github/workflows/go-version.yaml b/.github/workflows/go-version.yaml deleted file mode 100644 index 12831ed7715..00000000000 --- a/.github/workflows/go-version.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Go version setup - -on: - workflow_call: - outputs: - goversion: - value: ${{ jobs.version.outputs.goversion }} - -jobs: - version: - name: Set Go version variable for all the workflows - runs-on: ubuntu-latest - outputs: - goversion: ${{ steps.goversion.outputs.goversion }} - steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - id: goversion - run: | - GO_VERSION=$(cat .go-version) - echo "Go Version: $GO_VERSION" - echo "goversion=$GO_VERSION" >> $GITHUB_OUTPUT diff --git a/.github/workflows/grpcproxy.yaml b/.github/workflows/grpcproxy.yaml index 0710b7327d5..c4837eb41fc 100644 --- a/.github/workflows/grpcproxy.yaml +++ b/.github/workflows/grpcproxy.yaml @@ -1,11 +1,8 @@ name: grpcProxy-tests on: [push, pull_request] jobs: - goversion: - uses: ./.github/workflows/go-version.yaml test: runs-on: ubuntu-latest - needs: goversion strategy: fail-fast: true matrix: @@ -13,9 +10,11 @@ jobs: - linux-amd64-grpcproxy steps: - uses: actions/checkout@v2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v2 with: - go-version: ${{ needs.goversion.outputs.goversion }} + go-version: ${{ steps.goversion.outputs.goversion }} - run: date - env: TARGET: ${{ matrix.target }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9e3ab006fc6..d23297135d4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,16 +1,15 @@ name: Release on: [push, pull_request] jobs: - goversion: - uses: ./.github/workflows/go-version.yaml main: runs-on: ubuntu-latest - needs: goversion steps: - uses: actions/checkout@v2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v2 with: - go-version: ${{ needs.goversion.outputs.goversion }} + go-version: ${{ steps.goversion.outputs.goversion }} - name: release run: | set -euo pipefail diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2bde2eedfb0..5cf2c259f36 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,11 +1,8 @@ name: Tests on: [push, pull_request] jobs: - goversion: - uses: ./.github/workflows/go-version.yaml test: runs-on: ubuntu-latest - needs: goversion strategy: fail-fast: false matrix: @@ -19,9 +16,11 @@ jobs: - linux-386-unit-1-cpu steps: - uses: actions/checkout@v2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" - uses: actions/setup-go@v2 with: - go-version: ${{ needs.goversion.outputs.goversion }} + go-version: ${{ steps.goversion.outputs.goversion }} - run: date - env: TARGET: ${{ matrix.target }}