1+ name : Fabric CICD Full Refresh
2+ on :
3+ # pull_request:
4+ # branches:
5+ # - main
6+ workflow_dispatch : # Allows manual trigger from UI
7+
8+ jobs :
9+ dbt_run :
10+ name : dbt full refresh and test on Fabric
11+ runs-on : ubuntu-latest
12+
13+ env :
14+ # Environment variables
15+ PYTHON_VERSION : " 3.10"
16+ DBT_PROJECT_DIR : " ."
17+ DBT_CORE_VERSION : " 1.10.15"
18+ # Fabric connection variables
19+ DBT_FABRIC_CI_HOST : ${{ secrets.DBT_FABRIC_CI_HOST }}
20+ DBT_FABRIC_SERVICE_PRINCIPAL_ID : ${{ secrets.DBT_FABRIC_SERVICE_PRINCIPAL_ID }}
21+ DBT_FABRIC_SERVICE_PRINCIPAL_SECRET : ${{ secrets.DBT_FABRIC_SERVICE_PRINCIPAL_SECRET }}
22+ DBT_FABRIC_TENANT_ID : ${{ secrets.DBT_FABRIC_TENANT_ID }}
23+ DBT_FABRIC_CI_DATABASE : ${{ secrets.DBT_FABRIC_CI_DATABASE }}
24+ DBT_FABRIC_CI_SCHEMA : ${{ secrets.DBT_FABRIC_CI_SCHEMA }}
25+
26+ steps :
27+ - name : Checkout Code
28+ uses : actions/checkout@v4
29+
30+ - name : Set up Python
31+ uses : actions/setup-python@v4
32+ with :
33+ python-version : ${{ env.PYTHON_VERSION }}
34+
35+ - name : Install ODBC Driver 18 for SQL Server
36+ run : |
37+ curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
38+ curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
39+ sudo apt-get update
40+ sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
41+
42+ - name : Install dbt-core and Fabric adapter
43+ run : |
44+ python -m pip install --upgrade pip
45+ pip install dbt-core==${{ env.DBT_CORE_VERISON }} dbt-fabric
46+
47+ - name : Install dbt dependencies
48+ run : dbt deps --profiles-dir ./integration_tests/profiles/fabric
49+ working-directory : ${{ env.DBT_PROJECT_DIR }}
50+
51+ - name : Test connection
52+ run : dbt debug --profiles-dir ./integration_tests/profiles/fabric
53+ working-directory : ${{ env.DBT_PROJECT_DIR }}
54+
55+ - name : Build dbt models (full-refresh)
56+ run : |
57+ dbt build --full-refresh --profiles-dir ./integration_tests/profiles/fabric
58+ working-directory : ${{ env.DBT_PROJECT_DIR }}
0 commit comments