-
Notifications
You must be signed in to change notification settings - Fork 40
54 lines (50 loc) · 1.94 KB
/
ci.yml
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
name: CI
on:
- pull_request
- workflow_dispatch
jobs:
validate-json-schemas:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: install avj
run: npm install --no-save [email protected]
- name: validate all schema files
run: find ./schemas -name "*.json" | xargs -n 1 -I {} npx ajv-cli compile -s {} --strict=false
test-against-sample-dbt-files:
strategy:
matrix:
dbt-version: ["1.5", "1.6", "1.7", "latest"]
dbt-file-name: ["dbt_project", "packages", "selectors", "dbt_yml_files", "dependencies", "dbt_cloud"]
exclude:
- dbt-version: "1.5"
dbt-file-name: "dependencies"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: install avj
run: npm install --no-save [email protected]
- name: Validate dbt_project.yml sample files for dbt version ${{ matrix.dbt-version }}
run: |
npx ajv-cli test -s schemas/${{ matrix.dbt-version }}/${{ matrix.dbt-file-name }}-${{ matrix.dbt-version }}.json -d tests/${{ matrix.dbt-version }}/valid/${{ matrix.dbt-file-name }}.yml --valid
npx ajv-cli test -s schemas/${{ matrix.dbt-version }}/${{ matrix.dbt-file-name }}-${{ matrix.dbt-version }}.json -d tests/${{ matrix.dbt-version }}/invalid/${{ matrix.dbt-file-name }}.yml --invalid
validate_plusless_properties:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: install avj
run: |
python -m pip install --upgrade pip
pip install jsondiff
- name: Validate dbt_project.json has equivalent properties with and without pluses
run: |
python tests/validate_plusless_properties.py