-
Notifications
You must be signed in to change notification settings - Fork 43
67 lines (53 loc) · 1.37 KB
/
makefile.yml
File metadata and controls
67 lines (53 loc) · 1.37 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
56
57
58
59
60
61
62
63
64
65
66
67
name: Test Incoming Changes
on:
workflow_call:
inputs:
branch:
description: Branch to run on
required: true
default: main
type: string
workflow_dispatch:
push:
pull_request:
branches:
- main
- 'release-\d.\d\d'
jobs:
lint:
runs-on: ubuntu-24.04
env:
SHELL: /bin/bash
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.branch || github.sha }}
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Run lint
run: make lint
test:
runs-on: ubuntu-24.04
env:
SHELL: /bin/bash
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.branch || github.sha }}
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Run unit tests
run: make test
- name: Generate test coverage
run: go test ./pkg/... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
- name: Check test coverage
uses: vladopajic/go-test-coverage@v2
with:
# Configure action using config file (option 1)
config: ./.testcoverage.yml
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }}
git-branch: badges