Skip to content

Commit f5cf2ba

Browse files
authored
feat: added pr check and release actions
added pr-check and release action
2 parents bbf7e0d + 29e8866 commit f5cf2ba

2 files changed

Lines changed: 120 additions & 0 deletions

File tree

.github/workflows/pr-check.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
10+
jobs:
11+
Format:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v5
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v6
18+
with:
19+
go-version: '1.25.4'
20+
check-latest: true
21+
22+
- name: Format
23+
run: |
24+
# List files that would be reformatted
25+
unformatted=$(go fmt ./...)
26+
if [ -n "$unformatted" ]; then
27+
echo "The following files are not properly formatted:"
28+
echo "$unformatted"
29+
exit 1
30+
fi
31+
32+
Vet:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v5
36+
37+
- name: Set up Go
38+
uses: actions/setup-go@v6
39+
with:
40+
go-version: '1.25.4'
41+
check-latest: true
42+
43+
- name: Vet
44+
run: |
45+
result=$(go vet ./...)
46+
if [ -n "$result" ]; then
47+
echo "The following errors were reported by 'vet':"
48+
echo "$result"
49+
exit 1
50+
fi
51+
52+
Build:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v5
56+
57+
- name: Set up Go
58+
uses: actions/setup-go@v6
59+
with:
60+
go-version: '1.25.4'
61+
check-latest: true
62+
63+
- name: Build
64+
run: |
65+
result=$(go build ./...)
66+
if [ -n "$result" ]; then
67+
echo "The following errors were reported by 'build':"
68+
echo "$result"
69+
exit 1
70+
fi
71+
72+
# Test:
73+
# runs-on: ubuntu-latest
74+
# steps:
75+
# - uses: actions/checkout@v5
76+
77+
# - name: Set up Go
78+
# uses: actions/setup-go@v6
79+
# with:
80+
# go-version: '1.25.4'
81+
# check-latest: true
82+
83+
# - name: Test
84+
# run: |
85+
# go test -coverprofile=cover.out ./tests/... -coverpkg=./pkg/...,.,./internal/...
86+
87+
# - name: Coverage Report
88+
# uses: Jannik-Hm/go-test-coverage-report@v1.1
89+
# with:
90+
# coverprofile: cover.out

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
Release:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v5
18+
19+
- name: Bump version and push tag
20+
id: tag_version
21+
uses: mathieudutour/github-tag-action@v6.2
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Publish Release
26+
uses: ncipollo/release-action@v1
27+
with:
28+
generateReleaseNotes: true
29+
tag: ${{ steps.tag_version.outputs.new_tag }}
30+
prerelease: false

0 commit comments

Comments
 (0)