Skip to content

Commit 6eb6fed

Browse files
added dbt-doc- genearte
modified dbt-tests to include or exclude the unit_tests schema
1 parent 5405666 commit 6eb6fed

File tree

2 files changed

+72
-4
lines changed

2 files changed

+72
-4
lines changed

tasks/dbt-docs-generate/action.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Generate Docs
2+
description: Generates dbt documents
3+
inputs:
4+
target:
5+
description: The target to run DBT against
6+
required: true
7+
working-directory:
8+
description: The directory where the DBT project is located
9+
required: true
10+
profiles-directory:
11+
description: The directory where the DBT profiles are located
12+
required: true
13+
snowflake-account:
14+
description: The snowflake account to use
15+
required: true
16+
snowflake-username:
17+
description: The snowflake username to use
18+
required: true
19+
snowflake-password:
20+
description: The snowflake password to use
21+
required: true
22+
snowflake-role:
23+
description: The snowflake role to use
24+
required: true
25+
snowflake-warehouse:
26+
description: The snowflake warehouse to use
27+
required: true
28+
snowflake-target-database:
29+
description: The snowflake target database to use
30+
required: true
31+
32+
runs:
33+
using: "composite"
34+
steps:
35+
- name: Generate DBT docs without Unit-tets
36+
shell: bash
37+
run: |
38+
dbt docs generate --profiles-dir=${{ inputs.profiles-directory }} --target=${{ inputs.target }} --exclude tag:unit_test
39+
working-directory: ${{ inputs.working-directory }}
40+
env:
41+
snowflake-account: ${{ inputs.snowflake-account }}
42+
snowflake-username: ${{ inputs.snowflake-username }}
43+
snowflake-role: ${{ inputs.snowflake-role }}
44+
snowflake-warehouse: ${{ inputs.snowflake-warehouse }}
45+
snowflake-target-database: ${{ inputs.snowflake-target-database }}
46+
snowflake-password: ${{ inputs.snowflake-password }}
47+
48+
- name: Archive Dbt Docs
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: dbt-docs
52+
path: |
53+
./dbt/target/catalog.json
54+
./dbt/target/index.html
55+
./dbt/target/manifest.json

tasks/dbt-test/action.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,28 @@ inputs:
2929
required: true
3030
type: string
3131

32-
3332
runs:
3433
using: "composite"
3534
steps:
36-
- name: Run DBT Tests
37-
if: ${{ inputs.target }} != 'unit-test'
35+
- name: Run DBT Schema Only Tests
36+
if: inputs.target != 'unit-test'
37+
shell: bash
38+
run: |
39+
dbt test --profiles-dir=${{ inputs.profiles-directory }} --target=${{ inputs.target }} --exclude tag:unit_test
40+
working-directory: ${{ inputs.working-directory }}
41+
env:
42+
snowflake-account: ${{ inputs.snowflake-account }}
43+
snowflake-username: ${{ inputs.snowflake-username }}
44+
snowflake-role: ${{ inputs.snowflake-role }}
45+
snowflake-warehouse: ${{ inputs.snowflake-warehouse }}
46+
snowflake-target-database: ${{ inputs.snowflake-target-database }}
47+
snowflake-password: ${{ inputs.snowflake-password }}
48+
49+
- name: Run DBT Schema Tests and unit-tests
50+
if: inputs.target == 'unit-test'
3851
shell: bash
3952
run: |
40-
dbt test --profiles-dir=${{ inputs.profiles-directory }} --target=${{ inputs.target }} --exclude tag:daily tag:halfhourly tag:hourly tag:bihourly tag:unit_test
53+
dbt test --profiles-dir=${{ inputs.profiles-directory }} --target=${{ inputs.target }}
4154
working-directory: ${{ inputs.working-directory }}
4255
env:
4356
snowflake-account: ${{ inputs.snowflake-account }}

0 commit comments

Comments
 (0)