Skip to content

Continuous Integration (CI)

Mark edited this page Oct 21, 2023 · 3 revisions

GitHub Actions

Create .github/workflows/cypress.yml:

touch .github/workflows/cypress.yml

Update .github/workflows/cypress.yml:

name: cypress
on: push # or pull_request

jobs:
  cypress:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v3

      - name: Cypress run
        uses: cypress-io/github-action@v6
        with:
          browser: chrome
          start: npm start # update start command here
          wait-on: 'http://localhost:3000' # update server url here

      - name: Record failed screenshots
        if: failure()
        uses: actions/upload-artifact@v3
        with:
          name: cypress-screenshots
          path: cypress/screenshots

      - name: Record videos
        if: failure()
        uses: actions/upload-artifact@v3
        with:
          name: cypress-videos
          path: cypress/videos
Clone this wiki locally