test Actions #585
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: testing | |
| run-name: test Actions | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| run-all-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.9'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Cache Playwright browsers | |
| id: playwright-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ matrix.python-version }}-1.48.0 | |
| restore-keys: | | |
| playwright-${{ runner.os }}-${{ matrix.python-version }}-1.48.0- | |
| # Prevent "man-db" trigger updates during apt installs, which can take a long time | |
| - name: Remove man-db | |
| run: sudo apt-get purge -y man-db | |
| shell: bash | |
| - name: Install Playwright | |
| run: | | |
| # Install playwright dependencies if not cached | |
| if [ "${{ steps.playwright-cache.outputs.cache-hit }}" != "true" ]; then | |
| uv run playwright install chromium --with-deps | |
| fi | |
| shell: bash | |
| - name: Create uv virtual environment | |
| run: uv python pin ${{ matrix.python-version }} | |
| shell: bash | |
| - name: Project deps | |
| run: uv sync --dev --no-sources | |
| shell: bash | |
| - name: run test | |
| timeout-minutes: 4 | |
| run: uv run pytest tests/ | |
| shell: bash |