Update README.md #16
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: Python CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ${{ github.workspace }} # Better than hardcoded path | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| cache: 'pip' | |
| cache-dependency-path: 'requirements.txt' # Specific cache key | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install -r requirements.txt | |
| pip install pytest-cov | |
| - name: Run tests | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} | |
| SLACK_BOT_TOKEN: "mock_token" # Required for imports | |
| SLACK_APP_TOKEN: "mock_token" | |
| run: | | |
| python -m pytest tests/ -v --cov=src --cov-report=xml | |
| - name: Verify installation | |
| run: | | |
| python -c "import slack_bolt, psutil; print('✅ All dependencies installed')" | |
| - name: Verify imports | |
| run: | | |
| python -c "from src.automations.password_reset import generate_temp_password; print('✅ Import successful!')" | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v3 | |
| if: success() |