Skip to content

Commit

Permalink
Update Cypress workflow (#123)
Browse files Browse the repository at this point in the history
* Update Selenium setup URL in workflow

* Update Cypress workflow triggers

* update cypress
  • Loading branch information
devincowan authored Jan 31, 2024
1 parent f90353b commit 3b918e8
Show file tree
Hide file tree
Showing 5 changed files with 504 additions and 516 deletions.
48 changes: 8 additions & 40 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,17 @@
name: Cypress Tests with Dependency and Artifact Caching
# https://docs.cypress.io/guides/continuous-integration/github-actions

on: workflow_dispatch
on:
push:
branches:
- '*cypress*'
pull_request:
branches: [develop]
workflow_dispatch:

jobs:
install:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'npm'

- name: Cypress install
uses: cypress-io/github-action@v6
with:
# Disable running of tests within install job
runTests: false
build: npm run build

- name: Save build folder
uses: actions/upload-artifact@v3
with:
name: build
if-no-files-found: error
path: dist

cypress-run:
runs-on: ubuntu-22.04
needs: install
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -42,18 +21,7 @@ jobs:
with:
node-version: 14.x

- name: Download the build folder
uses: actions/download-artifact@v3
with:
name: build
path: dist

- name: Cypress run
uses: cypress-io/github-action@v6
with:
start: npx serve -s dist -p 8080
wait-on: 'http://localhost:8080'
browser: chrome
command: npm run cypress:run-component
# or install start-server-and-test and do:
# run: npm run test-component
component: true
2 changes: 1 addition & 1 deletion .github/workflows/selenium_browser_qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-beta-3/.github/actions/setup-chrome/action.yml
- name: Prepare Selenium
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update -qqy
sudo apt-get -qqy install google-chrome-stable
Expand Down
Loading

0 comments on commit 3b918e8

Please sign in to comment.