-
Notifications
You must be signed in to change notification settings - Fork 14
35 lines (34 loc) · 996 Bytes
/
format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Check Make Format
# this workflow checks that go files is formated by `make format`
on:
pull_request:
push:
branches:
- main
jobs:
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Display go version
run: go version
- uses: actions/cache@v3
id: cache
with:
path: ~/go/bin
key: ${{ runner.os }}-go-v1.20-misspell-v0.3.4-goimports-reviser-v3.4.5
- name: install misspell
if: steps.cache.outputs.cache-hit != 'true'
run: |
go install github.com/client9/misspell/cmd/misspell@v0.3.4
- name: install goimports-reviser
if: steps.cache.outputs.cache-hit != 'true'
run: |
go install github.com/incu6us/goimports-reviser/v3@v3.4.5
- name: Make Format
run: make format
- name: Check Diff
run: git diff --exit-code