-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (61 loc) · 2.28 KB
/
Copy pathintegration_tests.yml
File metadata and controls
72 lines (61 loc) · 2.28 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Integration Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
DBT_PROFILES_DIR: ${{ github.workspace }}/integration_tests
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dbt-snowflake
run: pip install dbt-snowflake>=1.9.4
- name: Write private key
run: |
echo "${{ secrets.SNOWFLAKE_PRIVATE_KEY }}" > /tmp/rsa_key.p8
chmod 600 /tmp/rsa_key.p8
- name: Create dbt profiles.yml
env:
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }}
SNOWFLAKE_ROLE: ${{ secrets.SNOWFLAKE_ROLE }}
SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }}
SNOWFLAKE_DATABASE: ${{ secrets.SNOWFLAKE_DATABASE }}
SNOWFLAKE_PRIVATE_KEY_PASSPHRASE: ${{ secrets.SNOWFLAKE_PRIVATE_KEY_PASSPHRASE }}
run: |
{
echo "integration_tests:"
echo " target: ci"
echo " outputs:"
echo " ci:"
echo " type: snowflake"
echo " account: \"${SNOWFLAKE_ACCOUNT}\""
echo " user: \"${SNOWFLAKE_USER}\""
echo " authenticator: snowflake_jwt"
echo " private_key_path: /tmp/rsa_key.p8"
if [ -n "$SNOWFLAKE_PRIVATE_KEY_PASSPHRASE" ]; then
echo " private_key_passphrase: \"${SNOWFLAKE_PRIVATE_KEY_PASSPHRASE}\""
fi
echo " role: \"${SNOWFLAKE_ROLE}\""
echo " warehouse: \"${SNOWFLAKE_WAREHOUSE}\""
echo " database: \"${SNOWFLAKE_DATABASE}\""
echo " schema: DBT_CI_TESTS"
echo " threads: 4"
} > integration_tests/profiles.yml
- name: Install dbt packages
working-directory: integration_tests
run: dbt deps
- name: Run dbt build (models + tests)
working-directory: integration_tests
run: dbt build
- name: Run macro unit tests
working-directory: integration_tests
run: dbt run-operation test_has_matching_nodes