Skip to content

Commit f66b16c

Browse files
committed
add workflow
1 parent 94ca71a commit f66b16c

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: scan-provider-agents
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'cvmassistants/secretprovider/secret-provider-agent/src/secret_provider_agent.c'
7+
- 'cvmassistants/keyprovider/key-provider-agent/src/key_provider_agent.c'
8+
push:
9+
branches:
10+
- test-scan-provider-agents-ci
11+
workflow_dispatch: {}
12+
13+
14+
jobs:
15+
scan-provider-agents:
16+
17+
name: Scan ${{ matrix.provider-agent.file }}
18+
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
matrix:
23+
provider-agent:
24+
- dir: cvmassistants/secretprovider/secret-provider-agent/src
25+
file: secret_provider_agent.c
26+
- dir: cvmassistants/keyprovider/key-provider-agent/src
27+
file: key_provider_agent.c
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Install tools directly
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y clang-format cppcheck
36+
37+
- name: Check if file changed
38+
id: changed
39+
uses: tj-actions/changed-files@v47
40+
with:
41+
files: ${{ matrix.provider-agent.dir }}/${{ matrix.provider-agent.file }}
42+
43+
- name: clang-format scan ${{ matrix.provider-agent.file }}
44+
if: steps.changed.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch'
45+
working-directory: ${{ matrix.provider-agent.dir }}
46+
run: |
47+
clang-format --dry-run -style=llvm --Werror ${{ matrix.provider-agent.file }}
48+
49+
- name: cppcheck scan ${{ matrix.provider-agent.file }}
50+
if: steps.changed.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch'
51+
working-directory: ${{ matrix.provider-agent.dir }}
52+
run: | # enable all checks and suppress missing include system since RATS-TLS dependencies are not included in the repo
53+
cppcheck --enable=all --suppress=missingIncludeSystem --error-exitcode=1 ${{ matrix.provider-agent.file }}

0 commit comments

Comments
 (0)