Skip to content

Commit e9c5e0e

Browse files
committed
On pull requests, run cypress with only chrome
Allow full cypress runs with all browsers on: * adhoc workflow_dispatch * pushes * schedule Currently, firefox is very slow, over 40 minutes, while chrome and edge are under 20 minutes each. For now, let's get chrome to verify PRs while we upgrade cypress and try to improve the speed further.
1 parent 25a4aa2 commit e9c5e0e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/cypress.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
name: Cypress
33
on:
4+
pull_request:
5+
push:
46
workflow_dispatch:
57
schedule:
68
- cron: 0 0 * * 0
@@ -37,36 +39,42 @@ jobs:
3739
TEST_SUITE: spec:cypress
3840
CYPRESS: true
3941
CYPRESS_BROWSER: ${{ matrix.cypress-browser }}
42+
RUN_CYPRESS: ${{ matrix.cypress-browser == 'chrome' || (matrix.cypress-browser != 'chrome' && github.event_name != 'pull_request') }}
4043
PGHOST: localhost
4144
PGPASSWORD: smartvm
4245
steps:
4346
- uses: actions/checkout@v4
4447
- name: Install Edge
4548
uses: browser-actions/setup-edge@v1
46-
if: ${{ matrix.cypress-browser == 'edge' }}
49+
if: ${{ matrix.cypress-browser == 'edge' && env.RUN_CYPRESS == 'true' }}
4750
- name: Set up system
4851
run: bin/before_install
52+
if: ${{ env.RUN_CYPRESS == 'true' }}
4953
- name: Set up Ruby
5054
uses: ruby/setup-ruby@v1
55+
if: ${{ env.RUN_CYPRESS == 'true' }}
5156
with:
5257
ruby-version: "${{ matrix.ruby-version }}"
53-
bundler-cache: true
58+
bundler-cache: 'true'
5459
timeout-minutes: 30
5560
- name: Set up Node
5661
uses: actions/setup-node@v4
62+
if: ${{ env.RUN_CYPRESS == 'true' }}
5763
with:
5864
node-version: "${{ matrix.node-version }}"
5965
cache: yarn
6066
- name: Prepare tests
6167
run: bin/setup
68+
if: ${{ env.RUN_CYPRESS == 'true' }}
6269
env: # We will be using the development database, so no need for the test database
6370
SKIP_TEST_RESET: "true"
6471
SKIP_DATABASE_RESET: "false"
6572
- name: Run tests
6673
run: bundle exec rake
74+
if: ${{ env.RUN_CYPRESS == 'true' }}
6775
- name: Save artifacts
6876
uses: actions/upload-artifact@v4
69-
if: failure()
77+
if: ${{ failure() && env.RUN_CYPRESS == 'true' }}
7078
with:
7179
name: cypress-${{ matrix.cypress-browser }}
7280
path: |

0 commit comments

Comments
 (0)