Skip to content

Commit

Permalink
Merge pull request #182 from EventStore/yoeight/go-version
Browse files Browse the repository at this point in the history
Set go version with shareable workflow.
  • Loading branch information
josephcummings authored Jun 28, 2024
2 parents 7b42179 + a233db6 commit a82e97b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/go-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Get Go version
on:
workflow_call:
outputs:
go_version:
description: Currently supported Go version
value: ${{ jobs.provide_go_version.outputs.go_version }}

jobs:
provide_go_version:
runs-on: ubuntu-latest
env:
GO_VERSION: 1.22
outputs:
go_version: ${{ steps.get.outputs.version }}
steps:
- name: Get Go version
id: get
run: echo "version=$GO_VERSION" >> $GITHUB_OUTPUT
1 change: 1 addition & 0 deletions .github/workflows/pull-request-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- "samples/**"
- "**_test.go"
- "**.md"
- ".github/**"
types: [opened, edited]
jobs:
checkPullRequest:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Build and Run Tests
on: [pull_request]
jobs:
go-version:
uses: ./.github/workflows/go-version.yml

build:
name: Code generation & compile
needs: go-version
strategy:
fail-fast: false
matrix:
Expand All @@ -14,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ vars.GO_VERSION }}
go-version: ${{ needs.go-version.outputs.go_version }}

- name: Generate protos and build project
run: make generate-protos-and-build
Expand All @@ -34,6 +38,8 @@ jobs:
uses: ./.github/workflows/tests.yml
with:
esdb_version: ${{ matrix.version }}
go_version: ${{ needs.go-version.outputs.go_version }}


linting:
needs: tests
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ on:
type: string

jobs:
go-version:
uses: ./.github/workflows/go-version.yml

test:
needs: go-version
name: Test
uses: ./.github/workflows/tests.yml
with:
esdb_version: ${{ inputs.version }}
go_version: ${{ needs.go-version.outputs.go_version }}
10 changes: 7 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
required: true
type: string

go_version:
required: true
type: string

jobs:
single_node:
name: Single node
Expand All @@ -21,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ vars.GO_VERSION }}
go-version: ${{ inputs.go_version }}

- name: Generate certificates
run: docker-compose --file docker-compose.yml up
Expand All @@ -45,7 +49,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ vars.GO_VERSION }}
go-version: ${{ inputs.go_version }}

- name: Generate certificates
run: docker-compose --file docker-compose.yml up
Expand All @@ -70,7 +74,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ vars.GO_VERSION }}
go-version: ${{ inputs.go_version }}

- name: Set up cluster with Docker Compose
run: |
Expand Down

0 comments on commit a82e97b

Please sign in to comment.