-
Notifications
You must be signed in to change notification settings - Fork 13
72 lines (69 loc) · 2.28 KB
/
go-template-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
name: Go-Template CI Master - Test
on:
pull_request_target:
branches:
- master
push:
branches:
- master
jobs:
lint-test-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v3
- name: SetupGoV5
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Get branch name
id: vars
run: echo ::set-output name=branch::${{ github.event.pull_request.head.ref }}
- name: Install pre-commit dependencies
run: |
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/go-critic/go-critic/cmd/gocritic@latest
go install golang.org/x/lint/golint@latest
go install github.com/BurntSushi/toml/cmd/tomlv@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- uses: pre-commit/[email protected]
- name: Build
run: go build ./...
- name: Test
run: ./scripts/test.sh
- name: Keploy test
run: chmod +x ./scripts/keploy_ci.sh && ./scripts/keploy_ci.sh
# - uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: true
# files: ./coverage.out
# verbose: true
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
with:
args: >
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# testing image url
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- uses: golangci/golangci-lint-action@v3