forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.34 KB
/
misc.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: misc
on:
push:
branches: [ "master" ]
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51
args:
--config=./.github/golangci.yml
fmt:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Install make
run: sudo apt-get install -y make
- name: Checkout code
uses: actions/checkout@v3
# prefill dependencies so that mod messages don't show up in make output
- name: Fetch dependencies
run: go mod download -modfile ./misc/devdeps/go.mod -x
# inspired by:
# https://github.com/Jerome1337/gofmt-action/blob/d5eabd189843f1d568286a54578159978b7c0fb1/entrypoint.sh
- name: Check gofumpt
run: |
output="$(GOFMT_FLAGS=-l make -s fmt)"
if [ ! -z "$output" ]; then
echo "The following files are not properly formatted; run 'make fmt' to format them."
echo "$output"
exit 1
else
echo 'Succeeded.'
fi