generated from ZEISS/template-go
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.18 KB
/
main.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
49
50
51
52
53
54
# .github/workflows/main.yml
name: Test & Lint
on:
workflow_call:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
permissions:
checks: write
strategy:
matrix:
go: [1.23.x, 1.22.x, 1.21.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache-dependency-path: |
tools/go.sum
- run: make test
- uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Go ${{ matrix.go }} Test Results
path: .test/reports/**-test.xml
reporter: java-junit
fail-on-error: "true"
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Test Report ${{ matrix.go }}
path: .test/reports/**
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
check-latest: true
cache-dependency-path: |
tools/go.sum
- run: make lint