Skip to content
check

GitHub Action

Airflow DAGs Test

v2.10.1 Latest version

Airflow DAGs Test

check

Airflow DAGs Test

Validate and test Airflow DAGs on your workflows

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Airflow DAGs Test

uses: micael-grilo/[email protected]

Learn more about this action in micael-grilo/airflow-dags-test-action

Choose a version

GitHub Action to Test Airflow Dags 🧪

Validate and test DAGs, before deploying to production by creating an isolated Airflow on Docker Container with supplied variables and dependencies.

Currently supports Airflow v2.0.2, v2.2.2, v2.4.3, v2.5.1, v2.6.3, v2.7.2, v2.8.1, v2.9.2 and v2.10.1

Main CI/CD Pipeline

Usage

workflow.yml Example

Place in a .yml file such as this one in your .github/workflows folder. Refer to the documentation on workflow YAML syntax here.

The following example includes optimal defaults for a standard airflow test solution:

  • 'requirements-file': Path to your requirements file requirements.txt.
  • 'dags-path': Path to your DAGs directory
  • 'dags-test-folder': Path to your tests directory
  • 'var-file': Path to your var.json to set your airflow variables, by default uses GitHub secrets.
  • 'error-comment': Boolean flag for whether to output the error message as a comment on the PR. Default is False.
- name: 'Test Airflow DAGs'
  uses: micael-grilo/[email protected]
    with:
      requirements-file: project/requirements.txt
      dags-path: project/dags
      dags-test-folder: project/tests
      var-file: project/var.json
      error-comment: True
      access-token: ${{ secrets.GITHUB_TOKEN }}

Contributions

Inspired by jayamanikharyono airflow-dag-action.

Contributions are very welcome. You can follow this standard contributions guidelines to contribute code.

License

This project is distributed under the MIT license.