diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 422392c0ad..4d704a0287 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -2,6 +2,7 @@ name: build-and-test on: [push, workflow_dispatch] jobs: build: + name: Django tests runs-on: ubuntu-20.04 strategy: matrix: @@ -28,5 +29,25 @@ jobs: run: make - name: Run eslint run: npm run eslint + cypress: + name: Cypress run + runs-on: ubuntu-latest + services: + postgres: + image: postgres:13 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + steps: + - uses: actions/checkout@v2 + - name: install memcached headers + run: apt install -y libmemcached-dev + - uses: browser-actions/setup-firefox@latest - name: Run Integration Tests - run: make cypress + uses: cypress-io/github-action@v4 + with: + command: npm run cypress:test + browser: firefox + headed: true diff --git a/package.json b/package.json index 596a7c8024..ddfb332e17 100644 --- a/package.json +++ b/package.json @@ -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",