cri.dev
about posts rss

Run Cypress Integration Tests with GitHub Actions Workflow

Published on

On this very site this deployment strategy is used with GitHub actions:

      - name: uat
        run: |
          npm start &
          npx cypress run

As you can see, I just start the development server anad then run the cypress tests with npx.

You can also use the official Cypress GitHub Action, like this:

name: christianfei-devblog build
on: [push]
jobs:
  build_deploy:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@master
        with:
          ref: refs/heads/master
      - name: install
        run: |
          npm install
      - name: build
        run: |
          npm run build
      - name: start server
        run: |
           npm start &
      - name: uat
        uses: cypress-io/github-action@v1

Easy as that. If you want to take a closer look at the workflow, check this out

ffmpeg-layer.png

Here, have a slice of pizza 🍕