forked from laminne/kojs3-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.12 KB
/
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
name: CI
on:
push:
branches:
- 'main'
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true
- name: Download Dependency
run: go mod download
- name: Compile
run: go build -o kojs .
golangci-lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run linter
uses: reviewdog/action-golangci-lint@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
golangci_lint_flags: "--config=./.golangci.yml ./..."
fail_on_error: true
reporter: "github-pr-review"
test:
name: Unit Test
runs-on: ubuntu-latest
needs: [Build]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true
- name: Test
run: go test -v ./... -coverprofile=coverage.out -race
- name: report coverage
uses: k1LoW/octocov-action@v0