@@ -37,27 +37,44 @@ jobs:
3737 uses : actions/setup-python@v6
3838 with :
3939 python-version : ${{ env.PYTHON_VERSION }}
40- cache : ' pip'
4140
42- - name : Install Airflow and dependencies
41+ - name : Install Airflow and initialize database
4342 run : |
43+ # Use the CI setup script for consistent environment
44+ chmod +x ./airflow/scripts/ci-setup.sh
45+
46+ # Install dependencies
4447 python -m pip install --upgrade pip
45- pip install "apache-airflow[postgres,celery]==${{ env.AIRFLOW_VERSION }}"
46- pip install pytest pytest-asyncio
48+ echo "Installing Apache Airflow ${{ env.AIRFLOW_VERSION }}..."
49+ # Use constraints to ensure compatible package versions
50+ PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
51+ CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${{ env.AIRFLOW_VERSION }}/constraints-${PYTHON_VERSION}.txt"
52+ echo "Using constraints: $CONSTRAINT_URL"
53+
54+ pip install "apache-airflow[postgres,celery]==${{ env.AIRFLOW_VERSION }}" --constraint "$CONSTRAINT_URL"
55+ echo "Installing SSH provider..."
56+ pip install "apache-airflow-providers-ssh" --constraint "$CONSTRAINT_URL"
57+ pip install pytest pytest-asyncio pyyaml
58+ echo "Airflow packages installed successfully"
4759
4860 # Install project dependencies
4961 if [ -f requirements.txt ]; then
5062 pip install -r requirements.txt
5163 fi
5264
53- - name : Initialize Airflow Database
54- run : |
65+ # Setup PATH and initialize DB
66+ SCRIPTS_DIR=$(python3 -c "import sysconfig; print(sysconfig.get_path('scripts'))")
67+ export PATH="$SCRIPTS_DIR:$PATH"
68+ echo "$SCRIPTS_DIR" >> $GITHUB_PATH
69+
70+ # Verify airflow is available
71+ which airflow
72+ airflow version
73+
5574 export AIRFLOW_HOME=${{ env.AIRFLOW_HOME }}
5675 airflow db init
5776
58- - name : Install PyYAML for Registry Validation
59- run : |
60- pip install pyyaml
77+ echo "[OK] Airflow installed and database initialized"
6178
6279 - name : Validate DAG Registry (ADR-0046)
6380 run : |
@@ -192,6 +209,10 @@ jobs:
192209 mkdir -p ${{ env.AIRFLOW_HOME }}/dags
193210 cp -r airflow/dags/* ${{ env.AIRFLOW_HOME }}/dags/ || true
194211
212+ # Add scripts directory to PATH
213+ SCRIPTS_DIR=$(python3 -c "import sysconfig; print(sysconfig.get_path('scripts'))")
214+ export PATH="$SCRIPTS_DIR:$PATH"
215+
195216 # List and validate DAGs
196217 echo "Listing DAGs..."
197218 airflow dags list || echo "⚠️ No DAGs found or error listing"
@@ -244,6 +265,9 @@ jobs:
244265 - name : Initialize Airflow
245266 run : |
246267 export AIRFLOW_HOME=${{ env.AIRFLOW_HOME }}
268+ # Add scripts directory to PATH for this step
269+ SCRIPTS_DIR=$(python3 -c "import sysconfig; print(sysconfig.get_path('scripts'))")
270+ export PATH="$SCRIPTS_DIR:$PATH"
247271 airflow db init
248272
249273 - name : Validate RAG Ingestion DAG
0 commit comments