Skip to content

Commit 907e40e

Browse files
committed
readme
1 parent f063a4e commit 907e40e

1 file changed

Lines changed: 68 additions & 51 deletions

File tree

.github/workflows/nightly.yml

Lines changed: 68 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ on:
66
workflow_dispatch:
77
inputs:
88
pytest_command:
9-
description: 'Custom pytest command'
9+
description: "Custom pytest command"
1010
required: true
1111
default: '-m "not devRun"'
1212
type: string
1313
parallelism:
14-
description: 'Number of machines to split tests'
14+
description: "Number of machines to split tests"
1515
required: false
1616
default: 2
1717
type: number
1818

1919
permissions:
20-
contents: write
20+
contents: read
2121
pages: write
22+
id-token: write
2223

2324
jobs:
2425
setup-matrix:
@@ -41,11 +42,12 @@ jobs:
4142
fail-fast: false
4243
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
4344
steps:
44-
- uses: actions/checkout@v5
45+
- name: Checkout
46+
uses: actions/checkout@v5
4547
- name: Set up Python
4648
uses: actions/setup-python@v6
4749
with:
48-
python-version: '3.13'
50+
python-version: "3.13"
4951
- name: Set up uv
5052
uses: astral-sh/setup-uv@v7
5153
with:
@@ -55,79 +57,94 @@ jobs:
5557
uv venv
5658
uv sync --all-extras --dev
5759
- name: Run Tests
58-
run: |
59-
xvfb-run .venv/bin/python -m pytest ${{ github.event.inputs.pytest_command || '-m "not devRun"' }} \
60-
--base-url ${{ vars.BASE_URL }} \
61-
--splits ${{ github.event.inputs.parallelism || 2 }} \
62-
--group ${{ matrix.group }}
63-
- name: Upload test results and artifacts
60+
run: >
61+
xvfb-run .venv/bin/python -m pytest
62+
${{ github.event.inputs.pytest_command || '-m "not devRun"' }}
63+
--base-url ${{ vars.BASE_URL }}
64+
--splits ${{ github.event.inputs.parallelism || 2 }}
65+
--group ${{ matrix.group }}
66+
- name: Upload shard test artifacts (test-results + allure-results)
6467
if: always()
65-
uses: actions/upload-artifact@v4.6.2
68+
uses: actions/upload-artifact@v5
6669
with:
67-
name: test-results-${{ matrix.group }}
70+
name: shard-${{ matrix.group }}
6871
path: |
6972
test-results/
70-
allure-results
73+
allure-results/
7174
retention-days: 7
7275

73-
merge-reports:
76+
build-report:
7477
needs: nightly-test
7578
if: always()
7679
runs-on: ubuntu-latest
7780
steps:
78-
- uses: actions/checkout@v5
79-
- name: Download all test results
81+
- name: Checkout
82+
uses: actions/checkout@v5
83+
- name: Download all Allure results into allure-results
84+
if: always()
8085
uses: actions/download-artifact@v5
8186
with:
87+
pattern: shard-*
8288
path: artifacts
83-
- name: Merge test results
89+
merge-multiple: false
90+
- name: Consolidate allure-results
91+
if: always()
92+
run: |
93+
mkdir -p allure-results
94+
find artifacts -type d -name "allure-results" -print0 | while IFS= read -r -d '' d; do
95+
cp -R "$d/." allure-results/
96+
done
97+
- name: Consolidate test-results into merged-test-results
98+
if: always()
8499
run: |
85100
mkdir -p merged-test-results
86-
for dir in artifacts/test-results-*/test-results; do
87-
cp -r $dir/* merged-test-results/
101+
find artifacts -type d -name "test-results" -print0 | while IFS= read -r -d '' d; do
102+
cp -R "$d/." merged-test-results/
88103
done
89-
- name: Upload Merged Test Results
90-
uses: actions/upload-artifact@v4.6.2
104+
- name: Upload merged test-results artifact
105+
if: always()
106+
uses: actions/upload-artifact@v5
91107
id: merged-artifact-upload
92108
with:
93109
name: merged-test-results
94110
path: merged-test-results/
95111
retention-days: 7
96-
- name: Merge Allure Results
97-
run: |
98-
mkdir -p allure-results
99-
for dir in artifacts/test-results-*/allure-results; do
100-
cp -r $dir/* allure-results/
101-
done
102-
- name: Link Git Information And Browser Version To Allure Report
103-
working-directory: allure-results
112+
- name: Link Git Information And Browser Version To Allure Results
104113
if: always()
114+
working-directory: allure-results
105115
run: |
106116
{
107-
echo BUILD_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
108-
echo GIT_BRANCH=${{ github.head_ref || github.ref_name }}
109-
echo GIT_COMMIT_ID=${{ github.sha }}
110-
echo GIT_COMMIT_MESSAGE=$(git show -s --format=%s HEAD)
111-
echo GIT_COMMIT_AUTHOR_NAME=$(git show -s --format='%ae' HEAD)
112-
echo GIT_COMMIT_TIME=$(git show -s --format=%ci HEAD)
113-
echo CHROME_VERSION=$(google-chrome --product-version)
117+
echo BUILD_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
118+
echo GIT_BRANCH=${{ github.ref_name }}
119+
echo GIT_COMMIT_ID=${{ github.sha }}
120+
echo GIT_COMMIT_MESSAGE="$(git show -s --format=%s HEAD)"
121+
echo GIT_COMMIT_AUTHOR_NAME="$(git show -s --format='%ae' HEAD)"
122+
echo GIT_COMMIT_TIME="$(git show -s --format=%ci HEAD)"
123+
echo CHROME_VERSION="$(google-chrome --product-version 2>/dev/null || true)"
114124
} >> environment.properties
115-
- name: Link Playwright Traces And Videos To Allure Report
125+
- name: Link Playwright Traces And Videos To Allure Results
126+
if: always()
116127
working-directory: allure-results
117-
if: contains(needs.*.result, 'failure')
118128
run: echo ARTIFACT_URL=${{ steps.merged-artifact-upload.outputs.artifact-url }} >> environment.properties
119-
- name: Generate Allure Report
120-
uses: simple-elf/allure-report-action@v1.13
129+
- name: Generate Allure report
121130
if: always()
122-
id: allure-report
123-
with:
124-
allure_results: allure-results
125-
allure_report: allure-report
126-
gh_pages: gh-pages
127-
allure_history: allure-history
128-
- name: Deploy Report To Github Pages
131+
run: npx -y allure generate allure-results --output allure-report
132+
- name: Upload Pages artifact
129133
if: always()
130-
uses: peaceiris/actions-gh-pages@v4
134+
uses: actions/upload-pages-artifact@v4
131135
with:
132-
github_token: ${{ secrets.GITHUB_TOKEN }}
133-
publish_dir: allure-history
136+
path: allure-report
137+
deploy_pages:
138+
needs: build-report
139+
if: always()
140+
runs-on: ubuntu-latest
141+
permissions:
142+
pages: write
143+
id-token: write
144+
environment:
145+
name: github-pages
146+
url: ${{ steps.deployment.outputs.page_url }}
147+
steps:
148+
- name: Deploy to GitHub Pages
149+
id: deployment
150+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)