Merge pull request #888 from InfuseAI/feature/sc-31643/support-piperi… #666
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run dbt tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [ '3.8', '3.9', '3.10', '3.11' ] | |
dbt: [ ">=1.3,<1.4", ">=1.4,<1.5", ">=1.5,<1.6", ">=1.6,<1.7" ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest "dbt-core${{ matrix.dbt }}" | |
pip install '.[duckdb]' | |
- name: Run tests | |
run: | | |
set +e | |
output=$(python -c "from dbt import version as v" 2>&1) | |
exit_code=$? | |
set -e | |
if [ $exit_code -eq 0 ]; then | |
python -mpytest tests/test_dbt_manifest_compatible.py tests/test_dbt_integeration.py tests/test_dbt_util.py | |
else | |
# https://github.com/dbt-labs/dbt-core/issues/6203#issuecomment-1319112890 | |
echo "Skip! dbt-core v1.3 only works with python less than 3.11" | |
fi | |
- name: Run jaffle shop | |
if: matrix.dbt != '>=1.3,<1.4' | |
run: | | |
pip install "dbt-duckdb${{ matrix.dbt }}" | |
./e2e-jaffle-shop/run.sh | |
path="/home/runner/work/piperider/piperider/e2e-jaffle-shop/jaffle_shop/.piperider/comparisons/latest/summary.md" | |
if [ ! -e "$path" ]; then | |
echo "The path '$path' does not exist." | |
exit 1 | |
fi | |