Skip to content

Commit af148e9

Browse files
committed
fix: unexpected eof
1 parent 2f1da56 commit af148e9

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ on:
1111
- 'v[0-9]+.[0-9]+.[0-9]+'
1212

1313
jobs:
14-
test-matrix:
15-
name: Test on ${{ matrix.os }}
14+
build-test:
15+
name: Build, Test & Coverage on ${{ matrix.os }}
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
@@ -30,36 +30,23 @@ jobs:
3030
- name: Build
3131
run: go build ./...
3232

33-
- name: Run Tests
34-
run: go test ./...
35-
36-
coverage:
37-
name: Code Coverage
38-
runs-on: ubuntu-latest
39-
40-
steps:
41-
- name: Checkout code
42-
uses: actions/checkout@v4
43-
44-
- name: Set up Go
45-
uses: actions/setup-go@v5
46-
with:
47-
go-version: '1.24.4'
48-
49-
- name: Run tests with coverage
33+
- name: Run Tests with Coverage
5034
run: |
5135
go test -coverprofile=coverage.out ./...
5236
go tool cover -func=coverage.out
37+
shell: bash
5338

54-
- name: Upload coverage artifact
39+
- name: Upload coverage report
40+
if: matrix.os == 'ubuntu-latest'
5541
uses: actions/upload-artifact@v4
5642
with:
5743
name: coverage-report
5844
path: coverage.out
5945

6046
format:
61-
name: Format
47+
name: Auto-format with gofmt (Linux only)
6248
runs-on: ubuntu-latest
49+
if: github.event_name == 'push' && github.repository_owner == github.actor
6350

6451
steps:
6552
- name: Checkout code
@@ -70,15 +57,16 @@ jobs:
7057
with:
7158
go-version: '1.24.4'
7259

73-
- name: Auto-format code and commit changes
60+
- name: Run gofmt and commit changes if needed
7461
run: |
7562
gofmt -w .
7663
if [ -n "$(git status --porcelain)" ]; then
77-
echo "Formatting changes detected. Committing..."
64+
echo "Code was not formatted. Committing changes..."
7865
git config user.name "github-actions"
7966
git config user.email "github-actions@github.com"
8067
git add .
8168
git commit -m "chore: auto-format Go code via gofmt"
8269
git push
8370
else
84-
echo "Code is already formatted. No changes needed."
71+
echo "Code already properly formatted."
72+
fi

0 commit comments

Comments
 (0)