-
Notifications
You must be signed in to change notification settings - Fork 91
110 lines (90 loc) · 3.74 KB
/
fusion.yml
File metadata and controls
110 lines (90 loc) · 3.74 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# **what?**
# Run tests using dbt Fusion against Snowflake
# **why?**
# To ensure that dbt-project-evaluator works as expected with dbt Fusion
# This runs alongside (not replacing) the existing dbt-core tests
# **when?**
# On every PR, and every push to main and when manually triggered
# **note**
# Currently only Snowflake is tested with Fusion. Additional adapters can be
# added to the matrix as Fusion support expands. Credentials are shared with
# the existing dbt-core Snowflake tests.
name: Fusion Integration Tests
on:
push:
branches:
- main
pull_request_target:
workflow_dispatch:
env:
PYTHON_VERSION: "3.11"
jobs:
run-duckdb-tests:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: "Checkout PR code"
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: "Set up Python ${{ env.PYTHON_VERSION }}"
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "Install dbt Fusion"
run: |
curl -fsSL https://public.cdn.getdbt.com/fs/install/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: "Verify Fusion installation"
run: |
dbt --version
- name: "Install tox"
run: |
python -m pip install --upgrade pip
pip install tox
- name: "Run Fusion integration tests on duckdb"
run: |
tox -e dbt_integration_fusion_duckdb
run-cloud-tests:
needs: run-duckdb-tests
runs-on: ubuntu-latest
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'cloud-tests' || '' }}
strategy:
fail-fast: false
matrix:
# Only Snowflake for now - add more adapters here as Fusion support expands
adapter: [snowflake]
steps:
- name: "Checkout PR code"
uses: actions/checkout@v4
with:
# For pull_request_target, we must explicitly checkout the PR head
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: "Set up Python ${{ env.PYTHON_VERSION }}"
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "Install dbt Fusion"
run: |
curl -fsSL https://public.cdn.getdbt.com/fs/install/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: "Verify Fusion installation"
run: |
dbt --version
- name: "Install tox"
run: |
python -m pip install --upgrade pip
pip install tox
- name: "Run Fusion integration tests on ${{ matrix.adapter }}"
run: |
tox -e dbt_integration_fusion_${{ matrix.adapter }}
env:
# snowflake
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_USER: ${{ vars.SNOWFLAKE_USER }}
DBT_ENV_SECRET_SNOWFLAKE_PASS: ${{ secrets.SNOWFLAKE_PASS }}
SNOWFLAKE_ROLE: ${{ vars.SNOWFLAKE_ROLE }}
SNOWFLAKE_DATABASE: ${{ vars.SNOWFLAKE_DATABASE }}
SNOWFLAKE_WAREHOUSE: ${{ vars.SNOWFLAKE_WAREHOUSE }}
SNOWFLAKE_SCHEMA: "fusion_integration_tests_${{ matrix.adapter }}_${{ github.run_number }}"