-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.2 KB
/
test.yaml
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
name: backend test
on:
push:
branches:
- master
- develop
pull_request:
workflow_dispatch:
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
jobs:
build:
name: build test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
id: setup-go
with:
go-version-file: 'go.mod'
cache: true
cache-dependency-path: go.sum
- name: Go Mod Download
if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
run: go mod download
- name: go build
run: go build -o main cmd/app/main.go
go-test:
name: build test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
id: setup-go
with:
go-version-file: 'go.mod'
cache: true
cache-dependency-path: go.sum
- name: Go Mod Download
if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
run: go mod download
- name: Test
run: go test -coverprofile=coverage.out ./... -coverpkg=./... -v -json | go run github.com/mfridman/tparse@v0.16.0