Skip to content

Commit

Permalink
ci: add check format workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
loloicci committed Sep 11, 2023
1 parent b5cb634 commit 28fbb81
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check Make Format
# this workflow checks that go files is formated by `make format`
on:
pull_request:
push:
branches:
- main

jobs:
install-tools:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with: go-version 1.18
- name: Display go version
run: go version
- name: install tools
run: |
go install github.com/client9/misspell/cmd/misspell@v0.3.4 &&
go install github.com/incu6us/goimports-reviser/v3@v3.4.5
- uses: actions/cache@v3
with:
path: ${GOPATH}/bin
key: ${{ runner.os }}-misspell-v0.3.4-goimports-reviser-v3.4.5

check-format:
runs-on: ubuntu-latest
needs: install-tools
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.18
- name: Display go version
run: go version
- name: Make Format
run: |
make format &&
git diff --exit-code

0 comments on commit 28fbb81

Please sign in to comment.