Skip to content

Commit

Permalink
ci: add fmt pipeline (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur authored Oct 2, 2024
1 parent 5827598 commit c95630d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/check-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check make fmt
on:
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
check-make-fmt:
name: Check make fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: install go1.21
uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: Run make fmt
run: make fmt

- name: Check if make fmt generated changes that should be committed
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: make fmt generated changes that should be committed. Please run 'make fmt' and commit the changes."
git diff
git status
exit 1
fi
1 change: 0 additions & 1 deletion .github/workflows/go.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
branches: [ "main" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit c95630d

Please sign in to comment.