Skip to content

Commit

Permalink
Merge pull request #77 from dbt-labs/version-files
Browse files Browse the repository at this point in the history
version all the files, update CI tests and vscode settings
  • Loading branch information
dave-connors-3 authored Jun 29, 2023
2 parents eb65e93 + 0c6d629 commit 0f52fde
Show file tree
Hide file tree
Showing 30 changed files with 4,707 additions and 32 deletions.
31 changes: 13 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: CI

on:
on:
- pull_request
- workflow_dispatch


jobs:
validate-json-schemas:
runs-on: ubuntu-latest
Expand All @@ -18,6 +17,13 @@ jobs:
- 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"]
dbt-file-name: ["dbt_project", "packages", "selectors", "dbt_yml_files", "dependencies"]
exclude:
- dbt-version: "1.5"
dbt-file-name: "dependencies"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -26,30 +32,19 @@ jobs:
node-version: 16
- name: install avj
run: npm install --no-save ajv-cli@5.0.0
- name: Validate dbt_project.yml sample files
run: |
npx ajv-cli test -s schemas/dbt_project.json -d tests/valid/dbt_project.yml --valid
npx ajv-cli test -s schemas/dbt_project.json -d tests/invalid/dbt_project.yml --invalid
- name: Validate resource yml sample files
run: |
npx ajv-cli test -s schemas/dbt_yml_files.json -d tests/valid/schema.yml --valid
npx ajv-cli test -s schemas/dbt_yml_files.json -d tests/invalid/schema.yml --invalid
- name: Validate packages.yml sample files
run: |
npx ajv-cli test -s schemas/packages.json -d tests/valid/packages.yml --valid
npx ajv-cli test -s schemas/packages.json -d tests/invalid/packages.yml --invalid
- name: Validate selectors.yml sample files
- name: Validate dbt_project.yml sample files for dbt version ${{ matrix.dbt-version }}
run: |
npx ajv-cli test -s schemas/selectors.json -d tests/valid/selectors.yml --valid
npx ajv-cli test -s schemas/selectors.json -d tests/invalid/selectors.yml --invalid
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'
python-version: "3.x"
- name: install avj
run: |
python -m pip install --upgrade pip
Expand Down
40 changes: 32 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,47 @@
{
"yaml.schemas": {
"./schemas/dbt_yml_files.json": [
"/*.yml",
"./schemas/1.5/dbt_yml_files-1.5.json": [
"/tests/1.5/**/*.yml",
"!profiles.yml",
"!dbt_project.yml",
"!packages.yml",
"!selectors.yml",
"!profile_template.yml",
"!/.github/**/*.yml"
],
"./schemas/dbt_project.json": [
"dbt_project.yml"
"./schemas/1.5/dbt_project-1.5.json": [
"/tests/1.5/**/dbt_project.yml"
],
"./schemas/selectors.json": [
"selectors.yml"
"./schemas/1.5/selectors-1.5.json": [
"/tests/1.5/**/selectors.yml"
],
"./schemas/packages.json": [
"packages.yml"
"./schemas/1.5/packages-1.5.json": [
"/tests/1.5/**/packages.yml"

],
"./schemas/1.6/dbt_yml_files-1.6.json": [
"/tests/1.6/**/*.yml",
"!profiles.yml",
"!dbt_project.yml",
"!packages.yml",
"!selectors.yml",
"!dependencies.yml",
"!profile_template.yml",
"!/.github/**/*.yml"
],
"./schemas/1.6/dbt_project-1.6.json": [
"/tests/1.6/**/dbt_project.yml"
],
"./schemas/1.6/selectors-1.6.json": [
"/tests/1.6/**/selectors.yml"
],
"./schemas/1.6/packages-1.6.json": [
"/tests/1.6/**/packages.yml"
],
"./schemas/1.6/dependencies-1.6.json": [
"/tests/1.6/**/dependencies.yml"
]

},
"sortJSON.orderOverride": [
"version",
Expand Down
Loading

0 comments on commit 0f52fde

Please sign in to comment.