forked from jackdos/par
-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (50 loc) · 2.78 KB
/
pr.yaml
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
name: Test and QA PR
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Checkout and build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
node-version: [19.8]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
npm install -g ajv-cli jsonlint
- name: Static Pylint code QA
run: pylint --errors-only **/*.py
- name: JSON linting
run: ./scripts/lint-json-dirs
- name: Run pre-commit tests
run: pre-commit run --all-files --verbose
- name: Test with pytest
run: pytest
- name: Compile and validate schema
run: |
ajv compile -s "schema/format.json" -r "schema/types.json" --validate-formats=false
ajv compile -s "schema/par-property.json" -r "schema/types.json" --validate-formats=false
ajv compile -s "schema/preservation-action-type.json" -r "schema/types.json" --validate-formats=false
ajv compile -s "schema/tool.json" -r "schema/types.json" --validate-formats=false
ajv compile -s "schema/preservation-action.json" -r "schema/types.json" -r "schema/format.json" -r "schema/par-property.json" -r "schema/tool.json" -r "schema/preservation-action-type.json" --validate-formats=false --strict=false
ajv compile -s "schema/business-rule.json" -r "schema/preservation-action.json" -r "schema/types.json" -r "schema/format.json" -r "schema/par-property.json" -r "schema/tool.json" -r "schema/preservation-action-type.json" --validate-formats=false --strict=false
ajv compile -s "schema/representation-format.json" -r "schema/types.json" --validate-formats=false --strict=false
ajv validate -s "schema/format.json" -d "examples/fmt-*.json" -r "schema/types.json" --validate-formats=false
ajv validate -s "schema/tool.json" -d "examples/md5*.json" -r "schema/types.json" --validate-formats=false
ajv validate -s "schema/business-rule.json" -d "examples/br-*.json" -r "schema/preservation-action.json" -r "schema/types.json" -r "schema/format.json" -r "schema/par-property.json" -r "schema/tool.json" -r "schema/preservation-action-type.json" --validate-formats=false --strict=false