Skip to content

Commit 74914fb

Browse files
committed
ci: run e2e tests on now deployments
fix #49
1 parent 3661673 commit 74914fb

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: E2E tests
2+
on: [deployment_status]
3+
4+
jobs:
5+
set_pending:
6+
name: Register pending E2E tests
7+
if: github.event.deployment_status.state == 'pending'
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
13+
- name: Set status to "pending"
14+
uses: ./.github/actions/set-pr-status
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB }}
17+
with:
18+
context: e2e tests
19+
status: pending
20+
message: Waiting for deployment
21+
22+
run_tests:
23+
name: Run E2E tests on deployment success
24+
if: github.event.deployment_status.state == 'success'
25+
runs-on: ubuntu-latest
26+
container: cypress/browsers:node13.6.0-chrome80-ff72
27+
env:
28+
NPM_RC: ${{ secrets.NPM_RC }}
29+
TERM: xterm
30+
31+
steps:
32+
- uses: actions/checkout@v1
33+
34+
- name: Set status to "running"
35+
uses: ./.github/actions/set-pr-status
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB }}
38+
with:
39+
context: e2e tests
40+
status: pending
41+
message: E2E tests are running
42+
43+
- name: Install dependencies
44+
run: yarn
45+
46+
- name: Run E2E tests
47+
run: yarn e2e --config baseUrl=${{ github.event.deployment_status.target_url }}
48+
49+
- name: Set status to "success"
50+
if: success()
51+
uses: ./.github/actions/set-pr-status
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB }}
54+
with:
55+
context: e2e tests
56+
status: success
57+
message: All tests are passed
58+
59+
- name: Set status to "failure"
60+
if: failure()
61+
uses: ./.github/actions/set-pr-status
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB }}
64+
with:
65+
context: e2e tests
66+
status: failure
67+
message: Some tests are failed

0 commit comments

Comments
 (0)