-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (41 loc) · 1.32 KB
/
test.golang.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
---
name: Test (Golang)
on: # yamllint disable-line rule:truthy
pull_request:
types: [opened, synchronize]
paths:
- .github/workflows/test.golang.yml
- go.*
- cmd/**
- pkg/**
push:
branches: [main]
jobs:
go-test:
name: Golang test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
# renovate: datasource=golang-version
go-version: '1.22'
check-latest: true
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run golang tests
run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./...
- name: Archive code coverage results
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: golang-coverage-report
path: coverage.out
retention-days: 1
codecov:
name: Codecov
runs-on: ubuntu-latest
needs: [go-test]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: golang-coverage-report
- uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0