Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update ci to use a single GO_VERSION setting in ci_release.yml #19

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,29 @@ on:
- major

jobs:
setup:
runs-on: ubuntu-latest
env:
# use consistent go version throughout pipeline here
GO_VERSION: "1.21"
outputs:
go-version: ${{ steps.set-vars.outputs.go-version }}
steps:
- name: Set go version
id: set-vars
run: echo "go-version=${{env.GO_VERSION}}" >> "$GITHUB_OUTPUT"

lint:
needs: [setup]
uses: ./.github/workflows/lint.yml
with:
go-version: ${{ needs.setup.outputs.go-version }}

test:
needs: [setup]
uses: ./.github/workflows/test.yml
with:
go-version: ${{ needs.setup.outputs.go-version }}

proto:
uses: ./.github/workflows/proto.yml
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
name: lint
on:
workflow_call:
inputs:
go-version:
description: 'Go version to use'
type: string
required: true

jobs:
golangci-lint:
Expand All @@ -12,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
go-version: ${{ inputs.go-version }}
# This steps sets the GIT_DIFF environment variable to true
# if files defined in PATTERS changed
- uses: technote-space/[email protected]
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
name: Tests / Code Coverage
on:
workflow_call:
inputs:
go-version:
description: "Go version to use"
type: string
required: true

jobs:
go_mod_tidy_check:
Expand All @@ -12,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
go-version: ${{ inputs.go-version }}
- run: go mod tidy
- name: check for diff
run: git diff --exit-code
Expand All @@ -25,7 +30,7 @@ jobs:
- name: set up go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
go-version: ${{ inputs.go-version }}
- name: Run unit test
run: make test
- name: upload coverage report
Expand All @@ -42,6 +47,6 @@ jobs:
- name: set up go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
go-version: ${{ inputs.go-version }}
- name: Integration Tests
run: echo "No integration tests yet"
Loading