Skip to content

ci: test on latest go #308

ci: test on latest go

ci: test on latest go #308

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [main]
jobs:
lint:
name: Lint & Tidy
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Checkout
uses: actions/checkout@v4
- name: Lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.46
- name: Tidy
run: go mod tidy
- name: Check Git Status
run: |
GIT_STATUS=$(git status --porcelain)
if [[ $GIT_STATUS ]]; then
echo $GIT_STATUS
echo "Git status is not clean, aborting"
exit 1
else
echo "No changes after tidy, continuing"
fi
test-1-18:
name: Test go1.18
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.18"
- 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
test-latest:
name: Test latest
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 30