-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.48 KB
/
go.yml
File metadata and controls
55 lines (44 loc) · 1.48 KB
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: Go
on: [push]
jobs:
build:
name: Test and Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1.0.0
with:
version: 1.13
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Create artifacts directory
run: mkdir -p artifacts
- name: Tests
run: go test ./... -json > artifacts/report.json
- name: Coverage
run: go test ./... -coverprofile=artifacts/coverage.out
- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0
- name: Run golangci-lint
run: $(go env GOPATH)/bin/golangci-lint run --out-format checkstyle > artifacts/golangci-lint-report.out || true
- uses: actions/upload-artifact@v1
with:
name: artifacts
path: artifacts
sonarCloudTrigger:
needs: build
name: SonarCloud Trigger
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@master
- name: Download code coverage results
uses: actions/download-artifact@v1
with:
name: artifacts
path: artifacts
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}