Merge pull request #16088 from jmhbnz/backport-gover-simplification

[3.5]  Backport .github/workflows: Read .go-version as a step and not separate workflow
This commit is contained in:
Marek Siarkowicz 2023-06-16 21:11:54 +02:00 committed by GitHub
commit 2c04d51eaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 41 deletions

View File

@ -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 }}

View File

@ -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 }}

View File

@ -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

View File

@ -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 }}

View File

@ -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

View File

@ -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 }}