Skip to content

Commit a96af4a

Browse files
committed
chore: add staging GHA flow
1 parent ce46f7e commit a96af4a

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Cypress Tests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
cypress-tests:
8+
runs-on: ubuntu-20.04
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
# run 3 copies of the current job in parallel
13+
containers: [1, 2, 3]
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
# populate commit message for merge commits
18+
# see https://currents.dev/readme/ci-setup/github-actions
19+
# with:
20+
# ref: ${{ github.event.pull_request.head.sha }}
21+
22+
- uses: actions/setup-node@v3
23+
with:
24+
node-version: 16
25+
26+
- name: Print Event Payload
27+
run: |
28+
cat $GITHUB_EVENT_PATH
29+
30+
- name: Print Env variables
31+
run: |
32+
printenv
33+
34+
# Install Currents
35+
- name: Install dependencies
36+
run: |
37+
npx ci
38+
39+
- name: Unblock Cypress
40+
run: |
41+
echo 🕊️ Download Free Cypress
42+
CYPRESS_DOWNLOAD_MIRROR=https://cy-cdn.currents.dev npx cypress install --force
43+
44+
echo ✅ Verify Cypress
45+
npx cypress verify
46+
47+
echo 👀 Cypress Cache
48+
npx cypress cache list
49+
npx cypress cache path
50+
51+
- name: Run Cypress on Currents.dev
52+
env:
53+
# enable verbose logging
54+
DEBUG: \@cypress/github-action
55+
CURRENTS_ENFORCE_IS_CURRENTS: 1
56+
CURRENTS_PROJECT_ID: 9aOuF6
57+
CURRENTS_API_URL: https://cy-staging.currents.dev
58+
uses: cypress-io/github-action@v6
59+
continue-on-error: true
60+
61+
with:
62+
# 🔥 Set to false to prevent restoring cached blocking Cypress binary
63+
install: false
64+
command: |
65+
npx cypress-cloud --record --parallel --browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} --ci-build-id ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}
66+
67+
- name: Cancel the run if workflow is cancelled
68+
if: ${{ cancelled() }}
69+
uses: currents-dev/cancel-run-gh-action@v1
70+
with:
71+
api-token: ${{ secrets.CURRENTS_API_KEY_STAGING }}
72+
github-run-id: ${{ github.run_id }}
73+
github-run-attempt: ${{ github.run_attempt }}

0 commit comments

Comments
 (0)