From d9af77b320adabd2bba38fe09df80aea0e90b46c Mon Sep 17 00:00:00 2001 From: Marcelo Guerrero Date: Tue, 7 May 2024 19:53:52 +0200 Subject: [PATCH] Extract go version from go.mod Signed-off-by: Marcelo Guerrero --- .github/workflows/build.yaml | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5574451..dd39116 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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: @@ -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 @@ -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 @@ -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