Skip to content

🎯 Orchestrate Airflow Validations #30

🎯 Orchestrate Airflow Validations

🎯 Orchestrate Airflow Validations #30

name: Test and Check on Pull Request
on: # yamllint disable-line rule:truthy
pull_request:
paths:
- orchestrate/*
- orchestrate/**/*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# This cancels a run if another change is pushed to the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
airflow:
name: Pull Request Airflow Tests
runs-on: ubuntu-latest
container: datacoves/ci-airflow-dbt-snowflake:3.2.202411071210-20e3cf4a
env:
AIRBYTE__EXTRACT_LOCATION: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/load
AIRFLOW__CORE__DAGS_FOLDER: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/orchestrate/dags
AIRFLOW__CORE__DAGBAG_IMPORT_TIMEOUT: 300
AIRFLOW__WEBSERVER__BASE_URL: http://airflow-dev123.datacoveslocal.com
DATACOVES__DBT_HOME: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/transform
DATACOVES__REPO_PATH: /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
steps:
- name: Checkout branch
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
# - name: Set Datacoves Snowflake Environment Variables
# run: |
# pip install dlt
# python /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/load/dlt/loans/datacoves_snowflake.py
# - name: Test DAG structure integrity (DagBag Loading)
# run: "python /usr/app/load_dagbag.py"
- name: Test DBT Sources against DAGs' YAML files
id: test_airflow_dags
run: |
python /usr/app/test_dags.py --dag-loadtime-threshold 1 --check-variable-usage
continue-on-error: true
- name: Test Warning Message
run: |
if [ ${{ steps.test_airflow_dags.outcome }} == 'failure' ]; then
echo "::warning file=app.py,line=10,col=5::DAGs have warnings. See test_dags results for more details."
else
echo "No warnings detected."
fi