-
Notifications
You must be signed in to change notification settings - Fork 84
142 lines (105 loc) · 3.78 KB
/
format.yml
File metadata and controls
142 lines (105 loc) · 3.78 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Format
on:
pull_request:
branches:
- main
- 'envoy-release/**'
- 'istio-release/**'
push:
branches:
- main
- 'envoy-release/**'
- 'istio-release/**'
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.run_id }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
addlicense:
name: verify licenses
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '^1.16'
- name: Install dependencies
run: |
go install github.com/google/addlicense@latest
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Format (addlicense)
run: addlicense -ignore "bazel/cargo/*/remote/**" -check .
buildifier:
name: check format with buildifier
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '^1.16'
- name: Install dependencies
run: |
go install github.com/bazelbuild/buildtools/buildifier@latest
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Format (buildifier)
run: find . -name "WORKSPACE" -o -name "*BUILD*" -o -name "*.bzl" | xargs -n1 buildifier -mode=check
rules_rust:
name: check format with rules_rust
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
with:
disk-cache: ${{ github.job }}
cache-save: ${{ github.event_name != 'pull_request' }}
- name: Format (bazel query)
run: |
bazel query 'deps(//bazel/cargo/...)'
- name: Format (rules_rust)
run: |
bazel run //bazel/cargo/wasmsign:crates_vendor
bazel run //bazel/cargo/wasmtime:crates_vendor
git diff --exit-code
clang_format:
name: check format with clang-format
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies (Linux)
run: sudo apt update -y && sudo apt install -y clang-format-18
- name: Format (clang-format)
run: |
find . -name "*.h" -o -name "*.cc" -o -name "*.proto" | grep -v ".pb." | xargs -n1 clang-format-18 -i
git diff --exit-code
clang_tidy:
name: check format with clang-tidy
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
with:
disk-cache: ${{ github.job }}
cache-save: ${{ github.event_name != 'pull_request' }}
- name: Bazel build
run: >
bazel build
--config=hermetic-llvm
--config clang-tidy
--define engine=multi
--copt=-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -c3-)\"
//...