Skip to content

Commit

Permalink
Test on Go 1.{18, 19}
Browse files Browse the repository at this point in the history
- Only test on 1.19 for Windows and Mac.
- Bump versions for checkout and setup-go actions. Use cache flag in
  setup-go instead of separate cache step.
  • Loading branch information
sudo-suhas committed Nov 13, 2022
1 parent 13aa048 commit 812da66
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- run: git fetch --force --tags

-
name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
cache: true
check-latest: true

-
name: Run GoReleaser
Expand Down
38 changes: 15 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,37 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest,macos-latest,windows-latest]
go-version: [1.14.x, 1.15.x, 1.17.x, 1.18.x]
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-new-combinations
exclude:
os: [ubuntu-latest]
go-version: [1.18.x, 1.19.x]
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-expanding-configurations
include:
- os: windows-latest
go-version: 1.14.x
go-version: 1.19.x
- os: macos-latest
go-version: 1.14.x
go-version: 1.19.x

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

# See https://github.com/actions/cache/blob/master/examples.md#go---modules
- name: Cache Go Modules
uses: actions/cache@v2
- name: Install Go
uses: actions/setup-go@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: ${{ matrix.go-version }}
cache: true

- name: Go install moq
run: go install -mod=readonly
run: go install

- name: Run vet
if: matrix.os == 'ubuntu-latest'
run: go vet -mod=readonly ./...
run: go vet ./...

- name: Lint
if: matrix.os == 'ubuntu-latest'
run: |
GO111MODULE=off go get -u golang.org/x/lint/golint
go install golang.org/x/lint/golint@latest
golint ./...
- name: Test
run: go test -mod=readonly ./...
run: go test ./...

0 comments on commit 812da66

Please sign in to comment.