-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (54 loc) · 1.48 KB
/
ci.yml
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
50
51
52
53
54
55
# See reference docs at
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: ci
on: [push, pull_request]
env:
GO_VERSION: "^1.19"
GOLANGCI_LINT_VERSION: "v1.56.2"
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Clone the repo
uses: actions/checkout@v2
- name: Enable caching
uses: actions/cache@v2
with:
# Increment cache number to invalidate.
key: ${{runner.os}}-cache-1
path: |
~/go/pkg
~/.cache/go-build
~/.cache/golangci-lint
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{env.GO_VERSION}}
- name: Install golangci-lint
run: |
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b $HOME $GOLANGCI_LINT_VERSION
- name: Lint
run: ~/golangci-lint run
test:
runs-on: ubuntu-22.04
steps:
- name: Clone the repo
uses: actions/checkout@v2
- name: Enable caching
uses: actions/cache@v2
with:
# Increment cache number to invalidate.
key: ${{runner.os}}-cache-1
path: |
~/go/pkg
~/.cache/go-build
~/.cache/golangci-lint
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{env.GO_VERSION}}
- name: Test
run: |
go version
go test ./...