Skip to content

Commit

Permalink
ci: test on latest go (#146)
Browse files Browse the repository at this point in the history
* add test on latest go

* fix actions

* fix tests

* upgrade linter version

* code cov on both versions

* Update codecov.yml

* Update codecov.yml
  • Loading branch information
mr-linch committed Mar 23, 2024
1 parent ab4b6bb commit a4f9904
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ignore:
- methods_gen.go
- examples
46 changes: 27 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,28 @@ name: CI
on:
pull_request:
push:
branches: [ main ]
branches: [main]

jobs:
lint:
name: Lint
name: Lint & Tidy
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.18"
go-version: stable

- name: Checkout
uses: actions/checkout@v4

- name: Lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.46

tidy:
name: Go Tidy
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.18"

- name: Checkout
uses: actions/checkout@v4
version: v1.57

- name: Tidy
run: make go-tidy
run: go mod tidy

- name: Check Git Status
run: |
Expand All @@ -49,8 +37,8 @@ jobs:
echo "No changes after tidy, continuing"
fi
test:
name: Test
test-go-1-18:
name: Test go1.18
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand All @@ -68,3 +56,23 @@ jobs:
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos

test-go-latest:
name: Test latest stable
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "stable"

- name: Checkout
uses: actions/checkout@v4

- name: Test
run: go test -timeout 30s -v -race -coverprofile=coverage.txt ./...

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos

0 comments on commit a4f9904

Please sign in to comment.