Skip to content

Commit

Permalink
create CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning committed Jul 16, 2023
1 parent 19c8f1e commit c7168e0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on: [push, pull_request]

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.20
- name: Check diff between gofmt and code
run: diff <(gofmt -d .) <(echo -n)

test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.18, 1.19, 1.20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Run tests
run: go test -v -race ./...

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.20
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53

0 comments on commit c7168e0

Please sign in to comment.