Merge pull request #193 from Xaxxoo/engagements #154
This file contains hidden or 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: Data Processing CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| lint: | |
| name: Lint Data Processing Code | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('apps/data-processing/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flake8 | |
| if [ -f apps/data-processing/requirements.txt ]; then pip install -r apps/data-processing/requirements.txt; fi | |
| - name: Lint with flake8 | |
| run: | | |
| flake8 apps/data-processing/ --max-line-length=127 | |
| test: | |
| name: Test Data Processing | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('apps/data-processing/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest | |
| if [ -f apps/data-processing/requirements.txt ]; then pip install -r apps/data-processing/requirements.txt; fi | |
| - name: Run tests | |
| run: | | |
| pytest apps/data-processing/ | |
| build-and-deploy: | |
| name: Build and Deploy Data Processing | |
| runs-on: ubuntu-latest | |
| needs: test | |
| timeout-minutes: 10 | |
| if: github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('apps/data-processing/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f apps/data-processing/requirements.txt ]; then pip install -r apps/data-processing/requirements.txt; fi | |
| - name: Build package | |
| run: | | |
| cd apps/data-processing | |
| python -m build | |
| - name: Deploy | |
| run: | | |
| echo "Deploying data processing to ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}" | |
| # Add deployment commands here (e.g., deploy to AWS/GCP) |