forked from castle/castle-go
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (71 loc) · 2.19 KB
/
go.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Go
on:
push:
env:
GOPRIVATE: "github.com/utilitywarehouse/*"
GOLANGCI_LINT_VERSION: "v1.52.2"
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- name: Install binaries
run: make install
- name: Format
run: make format
- name: Check for changes
run: git add . && git diff --staged --exit-code
lint:
runs-on: ubuntu-latest
steps:
- name: Configure git for private modules
run: git config --global url."https://${{ secrets.DEPLOY_GITHUB_USER }}:${{ secrets.DEPLOY_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
mod:
runs-on: ubuntu-latest
steps:
- name: Configure git for private modules
run: git config --global url."https://${{ secrets.DEPLOY_GITHUB_USER }}:${{ secrets.DEPLOY_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- name: Tidy modules
run: go mod tidy
- name: Check for changes
run: git add . && git diff --staged --exit-code
test:
runs-on: ubuntu-latest
steps:
- name: Configure git for private modules
run: git config --global url."https://${{ secrets.DEPLOY_GITHUB_USER }}:${{ secrets.DEPLOY_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- name: Install test runner
run: go install gotest.tools/gotestsum
- name: Test
run: make test