-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (54 loc) · 1.32 KB
/
main.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
name: main
on: [push, pull_request]
jobs:
golang-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.19'
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.19'
- run: go test ./... -tags=unit
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.19'
- uses: actions/checkout@v3
- uses: dominikh/staticcheck-action@v1.2.0
with:
version: "2022.1.2"
install-go: false
security-scanning:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: securego/gosec@master
with:
args: ./...
release:
needs: [golang-ci, unit-tests, code-quality, security-scanning]
runs-on: ubuntu-latest
if: ${{github.ref_name == 'main'}}
steps:
- uses: actions/checkout@master
- uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 19
branch: main
extra_plugins: |
@semantic-release/changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}