Skip to content
This repository was archived by the owner on May 31, 2023. It is now read-only.

Commit 0a28d6e

Browse files
author
Richard Patel
authored
.github: add golangci-lint and test (#4)
1 parent 0fb8754 commit 0a28d6e

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- main
8+
pull_request:
9+
permissions:
10+
contents: read
11+
jobs:
12+
golangci:
13+
name: lint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/setup-go@v2
17+
- uses: actions/checkout@v2
18+
with:
19+
go-version: 1.17.x
20+
- name: golangci-lint
21+
uses: golangci/golangci-lint-action@v2
22+
with:
23+
version: v1.44.2
24+
only-new-issues: true

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on: [ pull_request ]
2+
name: unit tests
3+
jobs:
4+
unit_tests:
5+
runs-on: ubuntu-20.04
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-go@v2
9+
with:
10+
go-version: 1.17.x
11+
- uses: actions/cache@v2
12+
with:
13+
path: |
14+
~/go/pkg/mod # Module download cache
15+
~/.cache/go-build # Build cache (Linux)
16+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
17+
restore-keys: |
18+
${{ runner.os }}-go-
19+
- name: Test
20+
run: go test ./... -v
21+
- name: Check Format
22+
run: '[ "$(gofmt -l ./ | wc -l)" -eq 0 ]'

0 commit comments

Comments
 (0)