Skip to content

Commit

Permalink
Update cypress github action config
Browse files Browse the repository at this point in the history
These changes separate out the cypress run from the django tests.

* cypress-io/cypress#22086
* https://github.com/cypress-io/github-action
  • Loading branch information
nikolas committed Oct 6, 2022
1 parent a36aa4f commit f103b82
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: build-and-test
on: [push, workflow_dispatch]
jobs:
build:
name: Django tests
runs-on: ubuntu-20.04
strategy:
matrix:
Expand All @@ -28,5 +29,25 @@ jobs:
run: make
- name: Run eslint
run: npm run eslint
cypress:
name: Cypress run
runs-on: ubuntu-latest
container:
image: cypress/browsers:node16.17.1-chrome105-ff104-edge
options: --user 1001
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Run Integration Tests
run: make cypress
uses: cypress-io/github-action@v4
with:
command: npm run cypress:test
browser: firefox
headed: true
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
"scripts": {
"test": "jest",
"cypress:run": "cypress run",
"cypress:chromerun": "cypress run --headless --browser chrome",
"cypress:chromeopen": "cypress open --browser chrome",
"cypress:chromehead": "cypress run --headed --browser chrome",
"cypress:ffrun": "cypress run --headless --browser firefox",
"cypress:ffopen": "cypress open --browser firefox",
"cypress:ffhead": "cypress run --browser firefox",
"cypress:ffhead": "cypress run --headed --browser firefox",
"cypress:test": "start-server-and-test 'make integrationserver' http-get://localhost:8000 cypress:ffhead",
"dev": "webpack --mode development --watch",
"eslint": "eslint media/js/app media/js/src media/js/src/*.jsx media/js/src/**/*.jsx media/js/pdf/*.js *.js",
Expand Down

0 comments on commit f103b82

Please sign in to comment.