Skip to content

Commit

Permalink
ci: check with multiple versions of Go
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
  • Loading branch information
rolinh committed Jul 11, 2023
1 parent 012f25f commit 741a58c
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,58 @@ on:

jobs:
go-mod:
strategy:
matrix:
go-version: ["1.19", "1.20", "1.21-rc.2"]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: 'oldstable'
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Check module vendoring
run: |
go mod tidy
go mod vendor
git diff --exit-code
build:
strategy:
matrix:
go-version: ["1.19", "1.20", "1.21-rc.2"]
runs-on: ubuntu-latest
needs: go-mod
steps:
- name: Install Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: 'oldstable'
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Go code prechecks
run: |
go build ./...
lint:
unit-test:
strategy:
matrix:
go-version: ["1.19", "1.20", "1.21-rc.2"]
runs-on: ubuntu-latest
needs: build
steps:
- name: Install Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Go code prechecks
run: |
go test ./...
lint:
runs-on: ubuntu-latest
needs: unit-test
steps:
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
Expand All @@ -51,17 +73,3 @@ jobs:
# for output
args: --config=.golangci.yml --verbose --out-${NO_FUTURE}format colored-line-number
skip-cache: true

unit-test:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Install Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: 'oldstable'
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Go code prechecks
run: |
go test ./...

0 comments on commit 741a58c

Please sign in to comment.