-
-
Notifications
You must be signed in to change notification settings - Fork 25
133 lines (128 loc) · 4.28 KB
/
Copy pathnightly.yml
File metadata and controls
133 lines (128 loc) · 4.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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
container:
image: mcr.microsoft.com/playwright:v1.55.0
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Set up uv
uses: astral-sh/setup-uv@v7
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 and artifacts
if: always()
uses: actions/upload-artifact@v4.6.2
with:
name: test-results-${{ matrix.group }}
path: |
test-results/
allure-results
retention-days: 7
merge-reports:
needs: nightly-test
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Download all test results
uses: actions/download-artifact@v5
with:
path: artifacts
- name: Merge test results
run: |
mkdir -p merged-test-results
for dir in artifacts/test-results-*/test-results; do
cp -r $dir/* merged-test-results/
done
- name: Upload Merged Test Results
uses: actions/upload-artifact@v4.6.2
id: merged-artifact-upload
with:
name: merged-test-results
path: merged-test-results/
retention-days: 7
- name: Merge Allure Results
run: |
mkdir -p allure-results
for dir in artifacts/test-results-*/allure-results; do
cp -r $dir/* allure-results/
done
- name: Link Git Information And Browser Version To Allure Report
working-directory: allure-results
if: always()
run: |
{
echo BUILD_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
echo GIT_BRANCH=${{ github.head_ref || github.ref_name }}
echo GIT_COMMIT_ID=${{ github.sha }}
echo GIT_COMMIT_MESSAGE=$(git show -s --format=%s HEAD)
echo GIT_COMMIT_AUTHOR_NAME=$(git show -s --format='%ae' HEAD)
echo GIT_COMMIT_TIME=$(git show -s --format=%ci HEAD)
echo CHROME_VERSION=$(google-chrome --product-version)
} >> environment.properties
- name: Link Playwright Traces And Videos To Allure Report
working-directory: allure-results
if: contains(needs.*.result, 'failure')
run: echo ARTIFACT_URL=${{ steps.merged-artifact-upload.outputs.artifact-url }} >> environment.properties
- name: Generate Allure Report
uses: simple-elf/allure-report-action@v1.13
if: always()
id: allure-report
with:
allure_results: allure-results
allure_report: allure-report
gh_pages: gh-pages
allure_history: allure-history
- name: Deploy Report To Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: allure-history