1818 github.event.deployment_status.state == 'success'
1919 ) || (
2020 github.event_name == 'pull_request' &&
21- github.event.action == 'labeled' &&
22- github.event.label.name == 'visual-test'
21+ github.event.action == 'labeled'
2322 )
2423 runs-on : ubuntu-latest
2524
@@ -32,30 +31,27 @@ jobs:
3231 repository : ClickHouse/clickhouse-docs
3332 path : ./
3433
35- - name : Fetch pull request labels
36- if : github.event_name == 'deployment_status'
37- id : fetch-labels
38- uses : actions/github-script@v6
39- with :
40- script : |
41- const pr = await github.pulls.get({
42- owner: context.repo.owner,
43- repo: context.repo.repo,
44- pull_number: context.payload.deployment_status.deployment.payload.pull_request.number
45- });
46- core.setOutput('labels', JSON.stringify(pr.data.labels));
47-
48- # Step 3: Check for "visual-test" label
49- - name : Check for "visual-test" label
50- id : label-check
51- run : |
52- echo "Checking for 'visual-test' label..."
53- echo "${{ steps.fetch-labels.outputs.labels }}" | jq '.[].name' | grep -q 'visual-test' && echo "true" || echo "false"
54- shell : bash
55- env :
56- LABELS : ${{ steps.fetch-labels.outputs.labels }}
57-
5834 - name : Log BASE_URL
5935 run : echo "BASE_URL=${{ github.event.deployment_status.environment_url }}"
6036 env :
61- BASE_URL : ${{ github.event.deployment_status.environment_url }}
37+ BASE_URL : ${{ github.event.deployment_status.environment_url }}
38+
39+ # Step 2: Setup node
40+ - name : Set up Node.js
41+ uses : actions/setup-node@v4
42+ with :
43+ node-version : ' 20.18.0'
44+ cache : ' yarn'
45+
46+
47+
48+ # Step 3: Run Playwright tests
49+ - name : Run Playwright tests
50+ run : yarn playwright test
51+ env :
52+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53+ BASE_URL : ${{ github.event.deployment_status.environment_url }}
54+ ARGOS_BRANCH : ${{ github.event.deployment_status.environment == 'Production' && 'main' || github.ref_name }}
55+ CI : true
56+ ARGOS_TOKEN : ${{ secrets.ARGOS_TOKEN }}
57+
0 commit comments