Skip to content

Commit

Permalink
Extract go version from go.mod
Browse files Browse the repository at this point in the history
Signed-off-by: Marcelo Guerrero <[email protected]>
  • Loading branch information
mlguerrero12 committed May 7, 2024
1 parent 5a3e17c commit d9af77b
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@ name: build

on: ["push", "pull_request"]

env:
GO_VERSION: "1.19"

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Check out code into the Go module directory
uses: actions/checkout@v4
go-version-file: go.mod

- uses: golangci/golangci-lint-action@v5
with:
Expand All @@ -26,13 +21,11 @@ jobs:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Check out code into the Go module directory
uses: actions/checkout@v4
go-version-file: go.mod

- name: Build
run: make build-bin
Expand All @@ -41,13 +34,11 @@ jobs:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Check out code into the Go module directory
uses: actions/checkout@v4
go-version-file: go.mod

- name: Test
run: make test
Expand All @@ -57,13 +48,11 @@ jobs:
needs: build
name: coverage
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Check out code into the Go module directory
uses: actions/checkout@v4
go-version-file: go.mod

- name: Go test with coverage
run: sudo make test-coverage # sudo needed for network interfaces creation
Expand Down

0 comments on commit d9af77b

Please sign in to comment.