Skip to content

Commit b6666f8

Browse files
committed
Testing CI setup
Signed-off-by: Marcin Olko <molko@google.com>
1 parent 921906a commit b6666f8

4 files changed

Lines changed: 64 additions & 3 deletions

File tree

.clang-tidy

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ HeaderFilterRegex: ".*/flagd/.*"
1414
ExcludeHeaderFilterRegex: ".*\\.pb\\.h|.*\\.grpc\\.pb\\.h"
1515

1616
# Treat all warnings as errors (optional, good for strict CI/CD)
17-
WarningsAsErrors: ""
17+
WarningsAsErrors: "*"
1818

1919
CheckOptions:
2020
- key: readability-identifier-naming.ClassCase
@@ -75,5 +75,3 @@ CheckOptions:
7575
value: 1
7676
- key: readability-braces-around-statements.ShortStatementLines
7777
value: 1
78-
79-
SystemHeaders: true
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: ci-format-test-lint
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
with:
15+
submodules: "recursive"
16+
17+
- uses: bazel-contrib/setup-bazel@0.18.0
18+
with:
19+
bazelisk-cache: true
20+
disk-cache: ${{ github.workflow }}
21+
repository-cache: true
22+
23+
- name: Build
24+
run: bazel build //...
25+
26+
- name: Test
27+
run: bazel test //test/...
28+
29+
lint:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v6
33+
with:
34+
submodules: "recursive"
35+
36+
- uses: bazel-contrib/setup-bazel@0.18.0
37+
with:
38+
bazelisk-cache: true
39+
disk-cache: ${{ github.workflow }}
40+
repository-cache: true
41+
42+
- name: Build
43+
run: bazel build //...
44+
45+
- name: Build compilation database
46+
run: bazel run @hedron_compile_commands//:refresh_all
47+
48+
- uses: cpp-linter/cpp-linter-action@v2
49+
id: linter
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
style: "file" # Use .clang-format config file.
54+
tidy-checks: "" # Use .clang-tidy config file.
55+
database: "compile_commands.json"
56+
extra-args: "--system-headers -fdiagnostics-absolute-paths"
57+
58+
- name: Fail fast?!
59+
if: steps.linter.outputs.checks-failed > 0
60+
run: exit 1

providers/flagd/src/configuration.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ FlagdProviderConfig::FlagdProviderConfig()
9595
!val.empty()) {
9696
offline_flag_source_path_ = val;
9797
}
98+
int i = 2;
9899
}
99100

100101
std::string FlagdProviderConfig::GetEffectiveTargetUri() const {

providers/flagd/src/configuration.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ class FlagdProviderConfig {
7575

7676
std::optional<std::string> offline_flag_source_path_;
7777
int offline_poll_interval_ms_;
78+
79+
int Test;
7880
};
7981

8082
} // namespace flagd

0 commit comments

Comments
 (0)