Skip to content

Commit

Permalink
Replace travis
Browse files Browse the repository at this point in the history
  • Loading branch information
logan2211 committed Sep 26, 2024
1 parent 2feca94 commit 7f6a7ef
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 26 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/validate-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: [push]
jobs:
validate-targets:
name: Validate smokeping targets
runs-on: ubuntu-24.04
steps:
- name: checkout self/this
uses: actions/checkout@v4
with:
fetch-depth: 0
path: self
- name: Install jsonschema
run: |
sudo apt-get install -y python3-jsonschema
- name: validate json
run: |
cd self
find targets -type f -print0 | xargs -0 -n1 jsonschema schema.json -i
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

55 changes: 41 additions & 14 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,48 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"hostname"
],
"properties": {
"name": {
"type": "string",
"pattern": "^[-_0-9a-zA-Z]+$"
"anyOf": [
{ "$ref": "#/$defs/target" },
{ "$ref": "#/$defs/group" }
]
},
"$defs": {
"target": {
"type": "object",
"required": [
"name",
"hostname"
],
"properties": {
"name": {
"type": "string",
"pattern": "^[-_0-9a-zA-Z]+$"
},
"probe": { "type": "string" },
"menu": { "type": "string" },
"title": { "type": "string" },
"hostname": { "type": "string" }
},
"probe": { "type": "string" },
"menu": { "type": "string" },
"title": { "type": "string" },
"hostname": { "type": "string" }
"additionalProperties": false
},
"additionalProperties": false
"group": {
"type": "object",
"required": [
"name",
"targets"
],
"properties": {
"name": {
"type": "string",
"pattern": "^[-_0-9a-zA-Z]+$"
},
"menu": { "type": "string" },
"targets": {
"type": "array",
"items": { "$ref": "#/$defs/target" }
}
},
"additionalProperties": false
}
}
}

0 comments on commit 7f6a7ef

Please sign in to comment.