-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (47 loc) · 1.48 KB
/
cypress.yml
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
name: Cypress Tests
on:
deployment_status:
workflow_dispatch:
inputs:
browser:
description: Cypress browser to use
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success' || github.event_name == 'workflow_dispatch'
steps:
- name: Get PR Number
uses: actions/github-script@v6
id: pr-number
with:
result-encoding: json
script: |
try {
const results = await github.rest.search.issuesAndPullRequests({
q: context.sha
});
const prs = [...results.data.items].sort((a, b) => a.score - b.score);
if (prs[0]) {
return prs[0].number;
}
} catch (e) {
console.error(e);
}
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Run Tests
uses: replayio/action-cypress@v0.2.2
with:
browser: ${{ github.event.inputs.browser || 'Replay Firefox' }}
api-key: ${{ secrets.CYPRESS_REPLAY_API_KEY }}
public: true
env:
RECORD_REPLAY_METADATA_SOURCE_MERGE_ID: ${{ steps.pr-number.outputs.result }}
CYPRESS_BASE_URL: ${{ github.event.deployment_status.target_url || 'https://www.replayable.dev/' }}