-
Notifications
You must be signed in to change notification settings - Fork 12
43 lines (42 loc) · 1.26 KB
/
server_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
name: Server CI
on:
pull_request:
branches: [develop, master]
paths:
- server/**
push:
branches: [develop, master]
paths:
- server/**
jobs:
build:
runs-on: ubuntu-latest
env:
working-directory: ./server
steps:
- uses: actions/checkout@v2
- name: Use Go
uses: actions/setup-go@v2
id: setup_go
with:
go-version: "1.18"
- name: Cache go-modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- run: go mod download
working-directory: ${{env.working-directory}}
- run: go get github.com/golangci/golangci-lint/cmd/[email protected]
working-directory: ${{env.working-directory}}
- run: golangci-lint run ./...
working-directory: ${{env.working-directory}}
- run: go test ./test/... -coverpkg ./action/... -coverprofile=cov.out
working-directory: ${{env.working-directory}}
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: ./server
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}