Skip to content

Commit 462e0fb

Browse files
authored
Add github workflow. (proxy-wasm#6)
Signed-off-by: John Plevyak <[email protected]>
1 parent a9c0c47 commit 462e0fb

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/workflows/cpp.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: C++
16+
17+
on:
18+
19+
pull_request:
20+
branches:
21+
- master
22+
23+
push:
24+
branches:
25+
- master
26+
27+
jobs:
28+
29+
format:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
35+
- name: Format (clang-format)
36+
run: |
37+
sudo apt-get install clang-format-9
38+
find . -name "*.h" -o -name "*.cc" -o -name "*.proto" | grep -v ".pb." | xargs -n1 clang-format-9 -i
39+
git diff --exit-code
40+
41+
- name: Format (buildifier)
42+
run: |
43+
go get -u github.com/bazelbuild/buildtools/buildifier
44+
export PATH=$PATH:$(go env GOPATH)/bin
45+
find . -name "BUILD" | xargs -n1 buildifier -mode=check
46+
- name: Format (addlicense)
47+
run: |
48+
go get -u github.com/google/addlicense
49+
export PATH=$PATH:$(go env GOPATH)/bin
50+
addlicense -check .
51+
52+
build:
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- uses: actions/checkout@v1
57+
58+
- name: Mount bazel cache
59+
uses: actions/cache@v1
60+
with:
61+
path: "/home/runner/.cache/bazel"
62+
key: bazel
63+
64+
- name: Install bazelisk
65+
run: |
66+
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64"
67+
mkdir -p "${GITHUB_WORKSPACE}/bin/"
68+
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
69+
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
70+
71+
- name: Test
72+
run: |
73+
"${GITHUB_WORKSPACE}/bin/bazel" test //...

0 commit comments

Comments
 (0)