Skip to content

Commit e2a4f34

Browse files
committed
ci: check go fmt, embed code in readme.md, use [email protected]
1 parent b8fd1f4 commit e2a4f34

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

.github/workflows/go.yml

+29-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,33 @@ on:
1010
branches: [ "main" ]
1111

1212
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
23+
- name: Install embedme
24+
run: npm install -g embedme
25+
26+
- name: Verify README.md embedded code
27+
run: npx embedme --verify README.md
28+
29+
- name: Set up Go
30+
uses: actions/setup-go@v4
31+
with:
32+
go-version: '1.20'
33+
34+
- name: Check formatting
35+
run: |
36+
if [ -n "$(go fmt ./...)" ]; then
37+
echo "Some files are not properly formatted. Please run 'go fmt ./...'"
38+
exit 1
39+
fi
1340
1441
build:
1542
strategy:
@@ -24,13 +51,13 @@ jobs:
2451
- name: Set up Go
2552
uses: actions/setup-go@v4
2653
with:
27-
go-version: '1.20'
54+
go-version: '1.23'
2855

2956
- name: Build
3057
run: go build -v ./...
3158

3259
- name: Test with coverage
33-
run: go test -p 1 -v -race -coverprofile=coverage.txt -covermode=atomic ./...
60+
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
3461

3562
- name: Upload coverage to Codecov
3663
if: matrix.os == 'ubuntu-24.04'

0 commit comments

Comments
 (0)