Skip to content

Commit

Permalink
Add CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
KasonBraley committed Jul 2, 2024
1 parent 2fe488a commit 993b989
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches:
- "main"
pull_request:

permissions:
contents: read

jobs:
lint:
name: lint
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 'stable', 'oldstable' ]
steps:
- name: Checkout code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: ${{ matrix.go-version }}
cache: true

- name: Run golangci-lint
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
with:
version: latest

test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 'stable', 'oldstable' ]
steps:
- name: Checkout code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: ${{ matrix.go-version }}
cache: true

- name: Verify dependencies
run: go mod verify

- name: check that 'go mod tidy' is clean
run: |
go mod tidy
git diff --name-only --exit-code || (echo "Please run 'go mod tidy'."; exit 1)
- name: Run tests
run: go test -race -v ./...

0 comments on commit 993b989

Please sign in to comment.