Skip to content

Commit 08d7077

Browse files
committed
Add GitHub Actions workflow for dbt integration tests
Add CI workflow that: 1. Installs Python dependencies and Feast 2. Installs dbt-core and dbt-duckdb 3. Runs dbt build to generate manifest.json 4. Sets up Feast project with SQLite 5. Tests feast dbt import command 6. Verifies Feast objects were created 7. Runs pytest integration tests Workflow runs on PRs that modify: - dbt integration code (feast/dbt/**) - dbt integration tests (tests/integration/dbt/**) - The workflow file itself Tests run on Python 3.11 and 3.12 to ensure compatibility. Signed-off-by: David Soria Parra <dsp@php.net> Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>
1 parent 34ee0c1 commit 08d7077

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: dbt-integration-tests
2+
3+
# Run dbt integration tests on PRs
4+
on:
5+
pull_request:
6+
paths:
7+
- 'sdk/python/feast/dbt/**'
8+
- 'sdk/python/tests/integration/dbt/**'
9+
- 'sdk/python/tests/unit/dbt/**'
10+
- '.github/workflows/dbt-integration-tests.yml'
11+
12+
jobs:
13+
dbt-integration-test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ["3.11", "3.12"]
18+
env:
19+
PYTHON: ${{ matrix.python-version }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
architecture: x64
28+
29+
- name: Install the latest version of uv
30+
uses: astral-sh/setup-uv@v5
31+
with:
32+
enable-cache: true
33+
34+
- name: Install dependencies
35+
run: make install-python-dependencies-ci
36+
37+
- name: Install dbt and dbt-duckdb
38+
run: |
39+
uv pip install --system dbt-core dbt-duckdb
40+
41+
- name: Run dbt commands
42+
run: |
43+
cd sdk/python/tests/integration/dbt/test_dbt_project
44+
dbt deps
45+
dbt build
46+
47+
- name: Setup Feast project for dbt import test
48+
run: |
49+
cd sdk/python/tests/integration/dbt
50+
mkdir -p feast_repo
51+
cd feast_repo
52+
cat > feature_store.yaml << EOF
53+
project: feast_dbt_test
54+
registry: data/registry.db
55+
provider: local
56+
online_store:
57+
type: sqlite
58+
path: data/online_store.db
59+
EOF
60+
mkdir -p data
61+
62+
- name: Test feast dbt import
63+
run: |
64+
cd sdk/python/tests/integration/dbt/feast_repo
65+
feast dbt import \
66+
-m ../test_dbt_project/target/manifest.json \
67+
-e driver_id \
68+
-d file \
69+
--tag feast
70+
71+
- name: Verify feast objects were created
72+
run: |
73+
cd sdk/python/tests/integration/dbt/feast_repo
74+
feast feature-views list
75+
feast entities list
76+
77+
- name: Run dbt integration tests
78+
run: |
79+
cd sdk/python
80+
python -m pytest tests/integration/dbt/test_dbt_integration.py -v --tb=short
81+
82+
- name: Minimize uv cache
83+
run: uv cache prune --ci

0 commit comments

Comments
 (0)