-
Notifications
You must be signed in to change notification settings - Fork 28
144 lines (128 loc) · 3.64 KB
/
checks.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Perform Checks on PR
on:
pull_request:
merge_group:
jobs:
tidy-pr:
name: Tidy PR
if: github.event_name == 'pull_request'
permissions:
contents: read # for TimonVS/pr-labeler-action to read config file
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to fetch all history for merging
- uses: TimonVS/pr-labeler-action@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
- name: Trunk Check
uses: trunk-io/trunk-action@v1
with:
post-annotations: true # only for fork PRs
test-builds:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Run Build Tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- name: Run Sonrd Build
run: make build
test-unit:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Run Unit Tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- run: make test-unit
test-race:
runs-on: ubuntu-latest
if: github.event_name == 'merge_group'
name: Run Race Tests
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- run: make test-race
test-cover:
runs-on: ubuntu-latest
if: github.event_name == 'merge_group'
name: Run Coverage Tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- run: make test-cover
validate-release:
if: github.event_name == 'merge_group'
runs-on: ubuntu-latest
name: Verify Release Config
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- name: Commitizen Dry Run
uses: commitizen-tools/commitizen-action@master
with:
push: false
dry_run: true
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
- name: Check GoReleaser Config
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: GoReleaser Dry Run
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --snapshot --clean --skip=publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}