From 188e5d84cbbbe5d8ff1d24d225bad151a2b3b6f2 Mon Sep 17 00:00:00 2001 From: "Micael F. Grilo" Date: Wed, 19 Jul 2023 15:27:07 +0100 Subject: [PATCH] Add support to airflow 2.5.1 (#3) --- .github/workflows/build.yml | 43 +++++++++++++++++++++++++++++++++++++ Dockerfile | 2 +- README.md | 4 ++-- project/requirements.txt | 2 +- 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7b9ebb7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,43 @@ +name: Create and publish a Docker image + +on: + push: + tags: + - 'v*' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 57c6c94..9957c12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.10 -RUN pip install apache-airflow==2.4.3 +RUN pip install apache-airflow==2.5.1 ADD entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh diff --git a/README.md b/README.md index ec8b956..11917f6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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](https://github.com/micael-grilo/airflow-dags-test-action/releases/tag/v2.0.2) and [v2.2.2](https://github.com/micael-grilo/airflow-dags-test-action/releases/tag/v2.2.2) and [v2.4.3](https://github.com/micael-grilo/airflow-dags-test-action/releases/tag/v2.4.3). +Currently supports Airflow [v2.0.2](https://github.com/micael-grilo/airflow-dags-test-action/releases/tag/v2.0.2), [v2.2.2](https://github.com/micael-grilo/airflow-dags-test-action/releases/tag/v2.2.2), [v2.4.3](https://github.com/micael-grilo/airflow-dags-test-action/releases/tag/v2.4.3) and [v2.5.1](https://github.com/micael-grilo/airflow-dags-test-action/releases/tag/v2.5.1) ![Main CI/CD Pipeline](https://github.com/micael-grilo/airflow-dags-test-action/workflows/Main%20CI/CD%20Pipeline/badge.svg) @@ -21,7 +21,7 @@ Place in a `.yml` file such as this one in your `.github/workflows` folder. [Ref ```yml - name: 'Test Airflow DAGs' - uses: micael-grilo/airflow-dags-test-action@v2.4.3 + uses: micael-grilo/airflow-dags-test-action@v2.5.1 with: requirements-file: project/requirements.txt dags-path: project/dags diff --git a/project/requirements.txt b/project/requirements.txt index c021c5b..70613be 100644 --- a/project/requirements.txt +++ b/project/requirements.txt @@ -1 +1 @@ -pytest==7.2.2 +pytest==7.4.0