Build & test Airflow #14
Workflow file for this run
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: Build & test Airflow | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt build | |
python -m build | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DUSERNAME }} | |
password: ${{ secrets.DPASSWORD }} | |
- name: Install & Run Airflow | |
run: | | |
PYPACKAGE=$(ls dist | grep .whl) | |
cp "dist/${PYPACKAGE}" tests_integration/plugins/ | |
cd tests_integration | |
echo "FROM apache/airflow:2.9.1" > Dockerfile | |
echo "ADD plugins/${PYPACKAGE} ." >> Dockerfile | |
echo "RUN pip install ${PYPACKAGE}" >> Dockerfile | |
echo -e "AIRFLOW_UID=$(id -u)" > .env | |
docker compose up -d airflow-init | |
docker compose up -d --build | |
- name: Add TM1 connection to Airflow | |
run: | | |
curl -X POST -H "Content-Type: application/json" -d '${{ vars.TM1CONN }}' http://localhost:8080/api/v1/connections --user airflow:airflow | |
- name: Test Airflow TM1 provider | |
run: | | |
cd tests_integration | |
echo "Running tests..." | |
# TODO | |
- name: Stop docker containers | |
run: | | |
cd tests_integration | |
docker compose down | |