Skip to content

Commit a7f1c4f

Browse files
committed
ci: check proto format
This patch enables CI for proto files.
1 parent 9178a3f commit a7f1c4f

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/lint.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- '**'
9+
pull_request:
10+
workflow_dispatch:
11+
12+
concurrency:
13+
# Update of a developer branch cancels the previously scheduled workflow
14+
# run for this branch. However, the 'master' branch and tag workflow runs
15+
# are never canceled.
16+
#
17+
# We use a trick here: define the concurrency group as 'workflow run ID' +
18+
# 'workflow run attempt' because it is a unique combination for any run.
19+
# So it effectively discards grouping.
20+
#
21+
# Important: we cannot use `github.sha` as a unique identifier because
22+
# pushing a tag may cancel a run that works on a branch push event.
23+
group: ${{ (
24+
github.ref == 'refs/heads/master' ||
25+
startsWith(github.ref, 'refs/tags/') ) &&
26+
format('{0}-{1}', github.run_id, github.run_attempt) ||
27+
format('{0}-{1}', github.workflow, github.ref) }}
28+
cancel-in-progress: true
29+
30+
jobs:
31+
protobuf:
32+
runs-on: ubuntu-20.04-self-hosted
33+
container:
34+
image: docker.io/tarantool/testing:ubuntu-focal
35+
36+
steps:
37+
- name: Prepare checkout
38+
uses: tarantool/actions/prepare-checkout@master
39+
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
submodules: recursive
44+
45+
- name: Install clang-format
46+
run: |
47+
apt-get update
48+
apt-get -y install clang-format
49+
50+
- name: Generate make files
51+
run: cmake .
52+
53+
- name: Checking protobuf syntax
54+
run: clang-format --dry-run --verbose -Werror *.proto

0 commit comments

Comments
 (0)