-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (65 loc) · 1.73 KB
/
workflow.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
72
73
74
75
76
77
78
79
name: OpenSource CI/CD
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
- main
- staging
- develop
pull_request:
branches:
- master
- main
- staging
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.21.4"
- name: Run build
run: go build .
lint:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.21.4"
- name: Install linters
run: |
go install golang.org/x/lint/golint@latest
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install github.com/client9/misspell/cmd/misspell@latest
go install github.com/gordonklaus/ineffassign@latest
# go install github.com/securego/gosec/cmd/gosec@latest
- name: Run golint
run: |
echo "Starting golint..."
golint ./...
echo "Completed golint"
- name: Run gocyclo
run: |
echo "Starting gocyclo..."
gocyclo -over 15 .
echo "Completed gocyclo"
- name: Run misspell
run: |
echo "Starting misspell..."
misspell -error .
echo "Completed misspell"
- name: Run ineffassign
run: |
echo "Starting ineffassign..."
ineffassign .
echo -e "\033[32mCompleted ineffassign\033[0m"
# - name: Run gosec
# run: gosec ./...