forked from brooklyn-data/dbt_artifacts
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.93 KB
/
github_actions_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
55
56
57
58
59
name: dbt_artifacts_ci
# triggers for the workflow
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
# environment variables
env:
# These should be configured in the GitHub -> secrets section of your repository
SNOWFLAKE_TEST_ACCOUNT: ${{ secrets.SNOWFLAKE_TEST_ACCOUNT }}
SNOWFLAKE_TEST_USER: ${{ secrets.SNOWFLAKE_TEST_USER }}
SNOWFLAKE_TEST_PASSWORD: ${{ secrets.SNOWFLAKE_TEST_PASSWORD }}
SNOWFLAKE_TEST_ROLE: ${{ secrets.SNOWFLAKE_TEST_ROLE }}
SNOWFLAKE_TEST_DATABASE: ${{ secrets.SNOWFLAKE_TEST_DATABASE }}
SNOWFLAKE_TEST_WAREHOUSE: ${{ secrets.SNOWFLAKE_TEST_WAREHOUSE }}
jobs:
ci_workflow:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8.x'
architecture: 'x64'
- name: Setup dbt
run: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip setuptools
pip install dbt-snowflake --upgrade
- name: Run Tests - Snowflake
run: |
. venv/bin/activate
cd ./integration_tests
export DBT_PROFILES_DIR=/home/runner/work/dbt_artifacts/dbt_artifacts/integration_tests
echo $DBT_PROFILES_DIR
dbt deps
dbt run-operation create_artifact_resources
dbt seed --full-refresh
dbt run-operation upload_dbt_artifacts --args '{filenames: [manifest, run_results]}'
dbt run --full-refresh
dbt run
dbt run-operation upload_dbt_artifacts --args '{filenames: [manifest, run_results]}'
dbt test
dbt run-operation upload_dbt_artifacts --args '{filenames: [run_results]}'
dbt source snapshot-freshness
dbt run-operation upload_dbt_artifacts --args '{filenames: [sources]}'
dbt docs generate
dbt run-operation upload_dbt_artifacts --args '{filenames: [catalog]}'