Skip to content

Commit 92ca968

Browse files
feat(json-schema-check): add new action (#240)
* feat(json-schema-check): add new action The goal is to check the compliance of configuration files against their Schema template. Leveraging the check-jsonschema CLI tool. Issue-Id: SCM-6366 Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com> Change-Id: I3ca864e58d408e85ed049266c3e703b8a19220b9 * Update json-schema-check/README.md * Update README.md --------- Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com> Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>
1 parent 73d6852 commit 92ca968

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ See the `README.md` in each directory.
8989
- [generate-changelog](./generate-changelog/README.md)
9090
- [get-modified-packages](./get-modified-packages/README.md)
9191
- [get-self-packages](./get-self-packages/README.md)
92+
- [json-schema-check](./json-schema-check/README.md)
9293
- [pre-commit](./pre-commit/README.md)
9394
- [register-autonomoustuff-repository](./register-autonomoustuff-repository/README.md)
9495
- [remove-exec-depend](./remove-exec-depend/README.md)

json-schema-check/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# json-schema-check
2+
3+
## Description
4+
5+
This action checks if the ROS 2 parameter files (`config/*.param.yaml`) of packages comply with the format of their template JSON Schema file (`schema/*.schema.json`).
6+
7+
## Usage
8+
9+
```yaml
10+
jobs:
11+
json-schema-check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Run json-schema-check
20+
uses: autowarefoundation/autoware-github-actions/json-schema-check@v1
21+
```
22+
23+
## Inputs
24+
25+
None.
26+
27+
## Outputs
28+
29+
None.

json-schema-check/action.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: json-schema-check
2+
description: ""
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Install JSON Schema packages
8+
run: |
9+
pip3 install -U check-jsonschema
10+
shell: bash
11+
12+
- name: Check configuration files
13+
run: |
14+
find -wholename '*/schema/*.schema.json' -execdir bash -c 'check-jsonschema --schemafile "$1" ../config/*.param.yaml' bash '{}' +
15+
shell: bash

0 commit comments

Comments
 (0)