-
Notifications
You must be signed in to change notification settings - Fork 333
70 lines (67 loc) · 2.05 KB
/
e2e.yaml
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
name: runs E2E tests
on:
workflow_run:
workflows: [Get info on PR]
types:
- completed
jobs:
setup_matrix:
name: Setup E2E Matrix
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.id == 21975579 || contains(github.event.pull_request.labels.*.name, 'build-fork')
outputs:
psh_url: ${{ steps.retrieve-url.outputs.psh_url }}
up_url: ${{ steps.retrieve-url.outputs.up_url }}
steps:
- name: Download info on PR
uses: dawidd6/action-download-artifact@v2
with:
workflow: get-pr-info.yaml
workflow_conclusion: completed
name: pr-info
- name: retrieve url
id: retrieve-url
run: |
PSH_URL=$(cat environment_url.txt)
echo "PSH URL is $PSH_URL"
UP_URL="https://docs.upsun.com.${PSH_URL:8}"
echo "UP URL is ${UP_URL}"
echo "psh_url=$PSH_URL" >> $GITHUB_OUTPUT
echo "up_url=$UP_URL" >> $GITHUB_OUTPUT
run_test:
runs-on: ubuntu-latest
name: Run E2E tests (${{ matrix.site }})
needs: setup_matrix
strategy:
matrix:
include:
- site: platformsh
url: ${{ needs.setup_matrix.outputs.psh_url }}
- site: upsun
url: ${{ needs.setup_matrix.outputs.up_url }}
steps:
- uses: actions/checkout@v4
- uses: cypress-io/github-action@v6
with:
wait-on: ${{ matrix.url }}
record: true
env:
CYPRESS_baseUrl: ${{ matrix.url }}
CYPRESS_environment: github
CYPRESS_site: ${{ matrix.site }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run_all_tests:
name: Report E2E tests for all sites
runs-on: ubuntu-latest
needs: run_test
if: ${{ always() }}
steps:
- name: Report matrix status
run: |
result="${{ needs.run_test.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi