-
Notifications
You must be signed in to change notification settings - Fork 16
65 lines (57 loc) · 1.97 KB
/
Copy pathverify-data.yml
File metadata and controls
65 lines (57 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: "Verify data"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
yamllint:
name: "YAML lint"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "YAML lint"
uses: karancode/yamllint-github-action@master
with:
yamllint_file_or_dir: "*.yaml"
yamllint_strict: false
yamllint_comment: false
- name: "Cache apt packages"
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: g++-14 libyaml-cpp-dev nlohmann-json3-dev
version: 1.0
- name: "Cache validator binary and dependencies"
id: cache-validator
uses: actions/cache@v4
with:
path: |
validate_yaml_file
json-schema-validator
key: validator-${{ hashFiles('validate_yaml_file.cpp') }}-v1
- name: "Fetch json-schema-validator"
if: steps.cache-validator.outputs.cache-hit != 'true'
run: |
rm -rf json-schema-validator
git clone --depth 1 https://github.com/pboettch/json-schema-validator.git json-schema-validator
- name: "Build YAML validator"
if: steps.cache-validator.outputs.cache-hit != 'true'
run: |
g++-14 -std=c++23 -O3 -Wall -Wextra \
$(pkg-config --cflags yaml-cpp) \
$(pkg-config --cflags nlohmann_json) \
-Ijson-schema-validator/src \
-o validate_yaml_file \
validate_yaml_file.cpp \
json-schema-validator/src/json-uri.cpp \
json-schema-validator/src/json-validator.cpp \
json-schema-validator/src/json-schema-draft7.json.cpp \
json-schema-validator/src/json-patch.cpp \
$(pkg-config --libs yaml-cpp)
- name: "Validate feature files"
run: |
for file in features_c*.yaml; do
echo "Verifying: $file"
./validate_yaml_file "$file"
done