-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 985 Bytes
/
test.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
name: Test
on:
workflow_call:
inputs:
GO_VERSION:
required: true
type: string
workflow_dispatch:
inputs:
GO_VERSION:
description: Go version to use
required: true
type: string
default: 1.22.4
permissions:
contents: read
jobs:
test:
name: Test application
runs-on: ubuntu-latest
steps:
- name: Checks-out repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.GO_VERSION }}
- name: Install dependencies
run: go mod download
- name: Run vet command
run: go vet .
- name: Run test
run: go test -v -coverprofile ./cover.out . && go tool cover -html ./cover.out -o ./cover.html
- name: Upload test results
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: coverage
path: ./cover.html