Skip to content

Commit

Permalink
fix: added ci for test and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
subomi committed Jan 29, 2024
1 parent 567ef78 commit 0502039
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and run all tests
on:
push:
branches:
- main
pull_request:

jobs:
test:
strategy:
matrix:
go-version: [1.20.x]
os: [ubuntu-latest, macos-latest]
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Cache go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}

- name: Check out code
uses: actions/checkout@v2

- name: Get and verify dependencies
run: go mod download && go mod verify

- name: Go vet
run: go vet ./...

- name: Go test
run: go test .
16 changes: 16 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: golangci-lint
on:
pull_request:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
only-new-issues: true
args: --timeout 3m --verbose

0 comments on commit 0502039

Please sign in to comment.