Skip to content

Commit 21ecf2f

Browse files
committed
Use version.mk golang version in CI
Signed-off-by: Evan Lezar <[email protected]>
1 parent 106cd98 commit 21ecf2f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/golang.yaml

+22-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ name: Golang
1616

1717
on:
1818
pull_request:
19+
types:
20+
- opened
21+
- synchronize
1922
branches:
2023
- main
2124
- release-*
@@ -29,28 +32,45 @@ jobs:
2932
runs-on: ubuntu-latest
3033
steps:
3134
- uses: actions/checkout@v4
32-
35+
name: Checkout code
36+
- name: Get Golang version
37+
id: vars
38+
run: |
39+
GOLANG_VERSION=$( grep "GOLANG_VERSION :=" versions.mk )
40+
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV
41+
- name: Install Go
42+
uses: actions/setup-go@v5
43+
with:
44+
go-version: ${{ env.GOLANG_VERSION }}
3345
- name: Lint
3446
uses: golangci/golangci-lint-action@v4
3547
with:
3648
version: latest
3749
args: -v --timeout 5m
3850
skip-cache: true
51+
- name: Check golang modules
52+
run: make check-vendor
3953
test:
4054
name: Unit test
4155
runs-on: ubuntu-latest
4256
steps:
4357
- name: Checkout code
4458
uses: actions/checkout@v4
59+
- name: Get Golang version
60+
id: vars
61+
run: |
62+
GOLANG_VERSION=$( grep "GOLANG_VERSION :=" versions.mk )
63+
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV
4564
- name: Install Go
4665
uses: actions/setup-go@v5
4766
with:
48-
go-version: '1.20'
67+
go-version: ${{ env.GOLANG_VERSION }}
4968
- run: make test
5069
build:
5170
runs-on: ubuntu-latest
5271
steps:
5372
- uses: actions/checkout@v4
73+
name: Checkout code
5474

5575
- name: Build
5676
run: make docker-build

0 commit comments

Comments
 (0)