Nightly Regression Tests #687
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: Nightly Regression Tests | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
inputs: | |
pytest_command: | |
description: 'Custom pytest command' | |
required: true | |
default: '-m "not devRun"' | |
type: string | |
parallelism: | |
description: 'Number of machines to split tests' | |
required: false | |
default: 2 | |
type: number | |
permissions: | |
contents: write | |
pages: write | |
jobs: | |
setup-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- id: set-matrix | |
run: | | |
count=${{ github.event.inputs.parallelism || 2 }} | |
matrix=$(seq -s ',' 1 $count) | |
echo "matrix=$(jq -cn --argjson groups "[$matrix]" '{group: $groups}')" >> $GITHUB_OUTPUT | |
nightly-test: | |
needs: setup-matrix | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} | |
env: | |
EMAIL: ${{ secrets.EMAIL }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: true | |
- name: Create venv & install dependencies | |
run: | | |
uv venv | |
uv sync --all-extras --dev | |
- name: Run Tests | |
run: | | |
xvfb-run .venv/bin/python -m pytest ${{ github.event.inputs.pytest_command || '-m "not devRun"' }} \ | |
--base-url ${{ vars.BASE_URL }} \ | |
--splits ${{ github.event.inputs.parallelism || 2 }} \ | |
--group ${{ matrix.group }} | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: allure-results-${{ matrix.group }} | |
path: allure-results | |
retention-days: 7 | |
merge-reports: | |
needs: nightly-test | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Merge and Publish Allure Report | |
uses: Valiantsin2021/allure-shard-results-publish@1.0.6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
add-env: 'true' |