Changehub/change1 git workflow #2
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: Run Web & API Tests on PR Merge | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| run-tests: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| python-version: [3.10] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install Playwright Browsers | |
| run: | | |
| source .venv/bin/activate | |
| playwright install --with-deps | |
| - name: Run API Tests | |
| run: | | |
| source .venv/bin/activate | |
| pytest -m api --tb=short --disable-warnings | |
| - name: Run Web Tests (Headless) | |
| run: | | |
| source .venv/bin/activate | |
| pytest -m web --tb=short --disable-warnings |