-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (49 loc) · 1.21 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: ci
on:
push:
branches: ["main"]
pull_request:
jobs:
commit-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
with:
configFile: .github/workflows/.commitlint.json
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v2
- name: Setup Go
uses: actions/[email protected]
with:
go-version: 1.17.x
- name: Setup Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ubuntu-latest-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
ubuntu-latest-go-
- name: Install Dependencies
run: go mod download
- name: Test
run: go test ./...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.45