Skip to content

Commit

Permalink
separate dbt and airflow integration jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Noel Gomez committed Oct 18, 2024
1 parent 6464899 commit c86690b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 30 deletions.
File renamed without changes.
40 changes: 40 additions & 0 deletions .github/workflows/integration_airflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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

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 }}/automate/airflow/dags
AIRFLOW__CORE__DAGBAG_IMPORT_TIMEOUT: 300

steps:
- name: Checkout branch
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Test DAG structure integrity (DagBag Loading)
run: "python /usr/app/load_dagbag.py"

- name: Test DBT Sources against DAGs' YAML files
run: "python /usr/app/test_dags.py --dag-loadtime-threshold 1 --check-variable-usage"
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on: # yamllint disable-line rule:truthy
paths:
- transform/*
- transform/**/*
- orchestrate/*
- orchestrate/**/*

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -18,8 +16,6 @@ concurrency:

jobs:
dbt:
if: ${{ contains(github.event.pull_request.changed_files, 'transform/') }}

name: Pull Request dbt Tests
runs-on: ubuntu-latest

Expand Down Expand Up @@ -114,29 +110,3 @@ jobs:
- name: Drop PR database on Failure to grant security access
if: always() && (env.DATACOVES__DROP_DB_ON_FAIL == 'true') && (steps.grant-access-to-database.outcome == 'failure')
run: "dbt --no-write-json run-operation drop_recreate_db --args '{db_name: ${{env.DATACOVES__MAIN__DATABASE}}, recreate: False}'" # yamllint disable-line rule:line-length

airflow:
if: ${{ contains(github.event.pull_request.changed_files, 'orchestrate/') }}

name: Pull Request Airflow Tests
runs-on: ubuntu-latest

container: datacoves/ci-airflow-dbt-snowflake:3.2

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 }}/automate/airflow/dags
AIRFLOW__CORE__DAGBAG_IMPORT_TIMEOUT: 300

steps:
- name: Checkout branch
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Test DAG structure integrity (DagBag Loading)
run: "python /usr/app/load_dagbag.py"

- name: Test DBT Sources against DAGs' YAML files
run: "python /usr/app/test_dags.py --dag-loadtime-threshold 1 --check-variable-usage"

0 comments on commit c86690b

Please sign in to comment.