-
Notifications
You must be signed in to change notification settings - Fork 14
79 lines (78 loc) · 2.29 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# 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.20"
GOLANGCI_LINT_VERSION: "v1.55.2"
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Clone the repo
uses: actions/checkout@v3
- name: Enable caching
uses: actions/cache@v3
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@v3
with:
go-version: ${{env.GO_VERSION}}
# Keep the linter version and its config in .golangci.yml in sync with the app repo at
# https://github.com/BitBoxSwiss/bitbox-wallet-app/blob/98e815c25950dc7f55a27551d053239e6fd804ca/Makefile#L24
- 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 --skip-dirs=cmd/playground,cmd/miniscript
test:
runs-on: ubuntu-22.04
steps:
- name: Clone the repo
uses: actions/checkout@v3
- name: Enable caching
uses: actions/cache@v3
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@v3
with:
go-version: ${{env.GO_VERSION}}
- name: Test
run: |
go version
go test ./...
build:
runs-on: ubuntu-22.04
steps:
- name: Clone the repo
uses: actions/checkout@v3
- name: Enable caching
uses: actions/cache@v3
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@v3
with:
go-version: ${{env.GO_VERSION}}
- name: Build
run: |
go version
go build ./...