Skip to content

Upgrade GitHub Actions to v4 to fix deprecation error #7

Upgrade GitHub Actions to v4 to fix deprecation error

Upgrade GitHub Actions to v4 to fix deprecation error #7

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11']
steps:
- name: Checkout code
uses: actions/checkout@v4 # UPDATED: v3 -> v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5 # UPDATED: v4 -> v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v4 # UPDATED: v3 -> v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov black flake8
- name: Lint with flake8
run: |
flake8 src/ app/ scripts/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src/ app/ scripts/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Check formatting with black
run: |
black --check src/ app/ scripts/
- name: Run tests with pytest
run: |
pytest tests/ -v --cov=src --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
build:
name: Build & Generate Reports
runs-on: ubuntu-latest
needs: test
if: success()
steps:
- name: Checkout code
uses: actions/checkout@v4 # UPDATED: v3 -> v4
- name: Set up Python 3.11
uses: actions/setup-python@v5 # UPDATED: v4 -> v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run analysis pipeline
run: |
mkdir -p outputs/reports outputs/dashboards outputs/figures
python scripts/run_full_analysis.py
- name: Validate reports
run: |
python -c "
from pathlib import Path
reports = [
'outputs/reports/competitive_analysis_summary.txt',
'outputs/reports/market_sizing_report.txt',
'outputs/reports/pricing_strategy_recommendation.txt',
'outputs/reports/gtm_strategy_report.txt',
'outputs/reports/financial_model_report.txt'
]
for r in reports:
assert Path(r).exists(), f'Missing report: {r}'
assert Path(r).stat().st_size > 1000, f'Report too small: {r}'
print('✅ All reports validated')
"
- name: Archive reports
uses: actions/upload-artifact@v4 # UPDATED: v3 -> v4 (The one causing your error)
with:
name: gtm-reports
path: outputs/reports/
retention-days: 30
- name: Archive dashboards
uses: actions/upload-artifact@v4 # UPDATED: v3 -> v4
with:
name: gtm-dashboards
path: outputs/dashboards/
retention-days: 30
deploy-docs:
name: Deploy documentation
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4 # UPDATED: v3 -> v4
- name: Deploy to GitHub Pages (Placeholder)
run: echo "Documentation deployment step would go here"