feat: add integration test on CI #79
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: Tests | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: [ ubuntu-latest ] | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ "3.10", "3.11" ] | |
airflow-version: [ "2.6.3", "2.7.3", "2.8.4", "2.9.3", "2.10.0", "2.10.1", "2.10.2", "2.10.3", "2.10.4" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Docker image | |
run: | | |
docker build \ | |
--build-arg AIRFLOW_USE_UV="true" \ | |
--build-arg AIRFLOW_VERSION=${{ matrix.airflow-version }} \ | |
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \ | |
--target airflow-dbt-af-ci \ | |
-t dbt-af-${{ matrix.airflow-version }}-py${{ matrix.python-version }} \ | |
. | |
- name: Run Docker container | |
run: | | |
docker run \ | |
-d \ | |
--name dbt-af-container-${{ matrix.airflow-version }}-py${{ matrix.python-version }} \ | |
dbt-af-${{ matrix.airflow-version }}-py${{ matrix.python-version }} | |
- name: Run tests | |
run: | | |
docker exec \ | |
dbt-af-container-${{ matrix.airflow-version }}-py${{ matrix.python-version }} \ | |
airflow db migrate && \ | |
pytest -q -s -vv --log-cli-level=INFO --cov=dbt_af --cov-report=term --run-airflow-tasks tests |