From f938d27eb897128e94bd24b7b3005a9dfd61e486 Mon Sep 17 00:00:00 2001 From: Ambroise Vincent Date: Tue, 20 Jun 2023 14:32:01 +0200 Subject: [PATCH 1/3] 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 Change-Id: I3ca864e58d408e85ed049266c3e703b8a19220b9 --- json-schema-check/README.md | 29 +++++++++++++++++++++++++++++ json-schema-check/action.yaml | 15 +++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 json-schema-check/README.md create mode 100644 json-schema-check/action.yaml diff --git a/json-schema-check/README.md b/json-schema-check/README.md new file mode 100644 index 00000000..6da731f9 --- /dev/null +++ b/json-schema-check/README.md @@ -0,0 +1,29 @@ +# json-schema-check + +## Description + +This action checks if the ROS2 parameter files (`config/*.param.yaml`) of packages comply with the format of their template JSON Schema file (`schema/*.schema.json`). + +## Usage + +```yaml +jobs: + json-schema-check: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Run json-schema-check + uses: autowarefoundation/autoware-github-actions/json-schema-check@v1 +``` + +## Inputs + +None. + +## Outputs + +None. diff --git a/json-schema-check/action.yaml b/json-schema-check/action.yaml new file mode 100644 index 00000000..9a5c89c1 --- /dev/null +++ b/json-schema-check/action.yaml @@ -0,0 +1,15 @@ +name: json-schema-check +description: "" + +runs: + using: composite + steps: + - name: Install JSON Schema packages + run: | + pip3 install -U check-jsonschema + shell: bash + + - name: Check configuration files + run: | + find -wholename '*/schema/*.schema.json' -execdir bash -c 'check-jsonschema --schemafile "$1" ../config/*.param.yaml' bash '{}' + + shell: bash From e7375e1648b85a965b1b003131a57b35d97ea485 Mon Sep 17 00:00:00 2001 From: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Date: Mon, 26 Jun 2023 18:35:52 +0900 Subject: [PATCH 2/3] Update json-schema-check/README.md --- json-schema-check/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json-schema-check/README.md b/json-schema-check/README.md index 6da731f9..f0e1b0da 100644 --- a/json-schema-check/README.md +++ b/json-schema-check/README.md @@ -2,7 +2,7 @@ ## Description -This action checks if the ROS2 parameter files (`config/*.param.yaml`) of packages comply with the format of their template JSON Schema file (`schema/*.schema.json`). +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`). ## Usage From eb12321b8c83b11c99905752acda12043efcd510 Mon Sep 17 00:00:00 2001 From: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com> Date: Mon, 26 Jun 2023 18:39:28 +0900 Subject: [PATCH 3/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d0347de4..9e6af84a 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ See the `README.md` in each directory. - [generate-changelog](./generate-changelog/README.md) - [get-modified-packages](./get-modified-packages/README.md) - [get-self-packages](./get-self-packages/README.md) +- [json-schema-check](./json-schema-check/README.md) - [pre-commit](./pre-commit/README.md) - [register-autonomoustuff-repository](./register-autonomoustuff-repository/README.md) - [remove-exec-depend](./remove-exec-depend/README.md)