Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Commit dd5c4ce

Browse files
committed
Update workflows for shared practice
Signed-off-by: Jose R. Gonzalez <komish@flutes.dev>
1 parent b7a54c5 commit dd5c4ce

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
name: Check PR
1+
name: Golang
22

33
on:
4-
pull_request:
5-
branches:
6-
- main
7-
- release-*
4+
workflow_call: {}
5+
workflow_dispatch: {}
86

97
jobs:
10-
build:
8+
sanity:
119
runs-on: ubuntu-latest
1210
steps:
1311
- uses: actions/checkout@v4
@@ -18,25 +16,25 @@ jobs:
1816
go-version-file: go.mod
1917

2018
- name: Tidy
21-
run: make tidy
19+
run: make ci.tidy
2220

2321
- name: Vet
2422
run: make vet
2523

2624
- name: Format
27-
run: make fmt
25+
run: make ci.fmt
2826

29-
- name: Run golangci linting checks
27+
- name: Lint
3028
run: make lint
3129

32-
# - name: Test
33-
# run: make cover
30+
- name: Test
31+
run: make cover
3432

3533
# - name: Coveralls
3634
# uses: coverallsapp/github-action@v2
3735
# with:
3836
# github-token: ${{ secrets.GITHUB_TOKEN }}
3937
# file: coverage.out
4038

41-
- name: Build a binary
39+
- name: Build
4240
run: make build
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
golang-sanity:
10+
uses: ./.github/workflows/golang.yaml

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ fmt: install.gofumpt
6565
tidy:
6666
go mod tidy
6767

68+
### Fail if git diff detects a change. Useful for CI.
69+
.PHONY: diff-check
70+
diff-check:
71+
git diff --exit-code
72+
73+
.PHONY: ci.fmt
74+
ci.fmt: fmt diff-check
75+
echo "=> ci.fmt done"
76+
77+
.PHONY: ci.tidy
78+
ci.tidy: tidy diff-check
79+
echo "=> ci.tidy done"
80+
6881
### Installing Developer Tools
6982
# gofumpt
7083
GOFUMPT = $(OUT_DIR)/gofumpt

0 commit comments

Comments
 (0)