-
Notifications
You must be signed in to change notification settings - Fork 29
82 lines (72 loc) · 2.07 KB
/
merge-group.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
name: Merge Group
on:
pull_request:
merge_group:
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
jobs:
test-race:
runs-on: ubuntu-latest
if: github.event_name == 'merge_group'
name: Test Race
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: Test Coverage
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-tag:
runs-on: ubuntu-latest
name: Validate Tag
if: github.event_name == 'merge_group'
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
id: cz
uses: commitizen-tools/commitizen-action@master
with:
push: false
dry_run: true
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
- name: Check if tag exists
run: |
DETERMINED_VERSION="${{ steps.cz.outputs.version }}"
if git ls-remote --tags origin "refs/tags/v${DETERMINED_VERSION}" | grep -q .; then
echo "::error::Tag v${DETERMINED_VERSION} already exists upstream"
exit 1
fi
echo "Tag v${DETERMINED_VERSION} does not exist - OK to proceed"