Skip to content

Commit

Permalink
wf
Browse files Browse the repository at this point in the history
  • Loading branch information
led0nk committed Apr 4, 2024
1 parent 78d03d4 commit e66f724
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,25 @@ on:
pull_request:

jobs:
go-versions:
name: lookup Go versions
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.versions.outputs.matrix }}
version: ${{ steps.versions.outputs.go-mod-version }}
latest: ${{ steps.versions.outputs.latest }}
steps:
- uses: actions/checkout@v4
- uses: arnested/go-version-action@v1
id: versions
setup-env:
runs-on: ubuntu-latest
needs: [go-versions]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21.8"
go-version: ${{ fromJSON(needs.go-versions.outputs.version) }}
- name: install gomods
run: make gomoddownload
- name: install tools
Expand All @@ -32,18 +44,6 @@ jobs:
run: make install-gotools
- name: lint code
run: make golint
go-versions:
name: lookup Go versions
runs-on: ubuntu-latest
needs: [setup-env]
outputs:
matrix: ${{ steps.versions.outputs.matrix }}
version: ${{ steps.versions.outputs.go-mod-version }}
latest: ${{ steps.versions.outputs.latest }}
steps:
- uses: actions/checkout@v3
- uses: arnested/go-version-action@v1
id: versions
test:
name: Test
strategy:
Expand All @@ -56,12 +56,11 @@ jobs:
- name: install Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
- name: Go test 1.21
go-version: ${{ matrix.go-version }}
- name: go test @version
if: startsWith( matrix.go-version , needs.go-versions.outputs.version )
run: echo "test 1.21"
- name: Go test 1.22
- name: go test @latest
if: startsWith( matrix.go-version , needs.go-versions.outputs.latest )
run: echo "test 1.22"
build:
Expand All @@ -70,10 +69,10 @@ jobs:
needs: [lint, test]
steps:
- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v5
with:
go-version: 1.22
go-version:${{ fromJSON(needs.go-versions.outputs.version) }}
- name: Check out code
uses: actions/checkout@v1
uses: actions/checkout@v5
- name: Build
run: make build

0 comments on commit e66f724

Please sign in to comment.