-
Notifications
You must be signed in to change notification settings - Fork 202
101 lines (90 loc) · 2.48 KB
/
ci.yml
File metadata and controls
101 lines (90 loc) · 2.48 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
name: CI
jobs:
test:
runs-on: ubuntu-latest
container: alpine:edge # latest go pls
steps:
- name: checkout
uses: actions/checkout@v6
- name: add dependencies
run: apk add go git tar
- name: Cache ctags
uses: actions/cache@v5
with:
path: /usr/local/bin/universal-ctags
key: ${{ runner.os }}-ctags-${{ hashFiles('install-ctags-alpine.sh') }}
- name: Cache Go modules
uses: actions/cache@v5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: install ctags
run: |
if [ ! -f /usr/local/bin/universal-ctags ]; then
./install-ctags-alpine.sh
fi
- name: test
run: go test ./...
shellcheck:
name: shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
shfmt:
name: shfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: reviewdog/action-shfmt@v1.0.4
with:
filter_mode: "nofilter"
fail_on_error: "true"
shfmt_flags: "-i 2 -ci -bn"
lint-protos:
name: "buf lint"
runs-on: ubuntu-latest
steps:
# Run `git checkout`
- uses: actions/checkout@v6
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GH_TOKEN }}
# Lint your Protobuf sources
- run: .github/workflows/buf-lint-check.sh
format-protos:
name: "buf format"
runs-on: ubuntu-latest
steps:
# Run `git checkout`
- uses: actions/checkout@v6
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GH_TOKEN }}
# Check to see if the Protobuf sources are formatted
- run: .github/workflows/buf-format-check.sh
generate-protos:
name: "buf generate"
runs-on: ubuntu-latest
steps:
# Run `git checkout`
- uses: actions/checkout@v6
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GH_TOKEN }}
# Check if the generated code is up-to-date
- run: .github/workflows/buf-generate-check.sh