-
Notifications
You must be signed in to change notification settings - Fork 3
107 lines (85 loc) · 2.34 KB
/
Copy pathtest.yml
File metadata and controls
107 lines (85 loc) · 2.34 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# SPDX-FileCopyrightText: 2025 GSI Helmholtzzentrum für Schwerionenforschung GmbH <https://www.gsi.de/en/>
#
# SPDX-License-Identifier: CC0-1.0
---
name: Build and Test
on: [push, pull_request]
permissions:
contents: read
checks: write
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.21', '1.22', '1.23', '1.24']
fail-fast: false
steps:
- uses: actions/checkout@v5
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Setup gotestsum
uses: autero1/action-gotestsum@v2.0.0
with:
gotestsum_version: 1.12.2
- name: Download dependencies
run: go mod download
- name: Verify dependencies
run: go mod verify
- name: Run go vet
run: go vet ./...
- name: Run tests
run: gotestsum --junitfile junit-report.xml -- -cover ./...
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: (success() || failure()) && matrix.go-version == '1.24'
with:
report_paths: 'junit-report.xml'
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.24']
goos: [linux]
goarch: [amd64]
fail-fast: false
steps:
- uses: actions/checkout@v5
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Download dependencies
run: go mod download
- name: Build Debug
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
go build -buildvcs=true -v ./cmd/bmctl
- name: Upload build artifacts
if: matrix.go-version == '1.24'
uses: actions/upload-artifact@v4
with:
name: bmctl-${{ matrix.goos }}-${{ matrix.goarch }}-debug
path: |
bmctl*
retention-days: 30
lint:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.24']
steps:
- uses: actions/checkout@v5
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Run golangci-lint (includes gofumpt)
uses: golangci/golangci-lint-action@v8
with:
version: latest