-
Notifications
You must be signed in to change notification settings - Fork 563
117 lines (101 loc) · 2.76 KB
/
go.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
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
108
109
110
111
112
113
114
115
116
117
name: Go
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, macos-12]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Test
run: |
go test -v ./... -coverprofile=${{ matrix.os }}_coverage.txt -covermode=atomic
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}_reports
path: ${{ matrix.os }}_coverage.txt
if-no-files-found: error
retention-days: 1
- name: Install
run: go install ./cmd/saml2aws
linting:
name: lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.55.2
args: --timeout=2m
coverage:
name: coverage
permissions:
contents: read
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ubuntu-latest_reports
path: reports
- uses: actions/download-artifact@v4
with:
name: macOS-latest_reports
path: reports
- uses: actions/download-artifact@v4
with:
name: macos-12_reports
path: reports
- name: Codecov
uses: codecov/codecov-action@v4
with:
directory: reports
flags: unittests
release-build:
name: release-build
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-20.04
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: 1.20.x
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Install dependency required for linux builds
if: matrix.os == 'ubuntu-20.04'
run: sudo apt-get update && sudo apt-get install -y libudev-dev
- name: GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: build --snapshot --clean --config .goreleaser.${{ matrix.os }}.yml
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}_saml2aws
path: dist/