|
| 1 | +name: Example Cypress GitHub Actions |
| 2 | +# This example workflow demonstrates |
| 3 | +# GitHub Actions (https://docs.github.com/en/actions) using the |
| 4 | +# Cypress JavaScript GitHub Action (https://github.com/cypress-io/github-action) with |
| 5 | +# Cypress Docker images (https://github.com/cypress-io/cypress-docker-images) |
| 6 | + |
| 7 | +# The workflow is triggered manually on demand, see |
| 8 | +# https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow |
| 9 | +# To automatically trigger a workflow, for instance on a push event, see |
| 10 | +# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow |
| 11 | + |
| 12 | +on: workflow_dispatch |
| 13 | + |
| 14 | +jobs: |
| 15 | + docker-base: |
| 16 | + runs-on: ubuntu-22.04 |
| 17 | + container: |
| 18 | + # Examples use latest tag |
| 19 | + # For production use, to avoid the risk of breaking changes, |
| 20 | + # choose a fixed version tag from |
| 21 | + # https://hub.docker.com/r/cypress/base/tags |
| 22 | + image: cypress/base:latest |
| 23 | + # User 1001 matches the owner of the HOME directory which GitHub Actions creates |
| 24 | + # Selecting the same user minimizes permissions issues |
| 25 | + options: --user 1001 |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - uses: cypress-io/github-action@v6 |
| 29 | + with: |
| 30 | + # Only the Electron browser is available with cypress/base |
| 31 | + # This is the default browser and does not need to be specified |
| 32 | + working-directory: examples/basic |
| 33 | + |
| 34 | + docker-browsers: |
| 35 | + runs-on: ubuntu-22.04 |
| 36 | + strategy: |
| 37 | + # Makes sure that each browser test runs, even if any other test fails |
| 38 | + fail-fast: false |
| 39 | + matrix: |
| 40 | + browser: [chrome, edge, firefox] |
| 41 | + container: |
| 42 | + # Examples use latest tag |
| 43 | + # For production use, to avoid the risk of breaking changes, |
| 44 | + # choose a fixed version tag from |
| 45 | + # https://hub.docker.com/r/cypress/browser/tags |
| 46 | + image: cypress/browsers:latest |
| 47 | + options: --user 1001 |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + - uses: cypress-io/github-action@v6 |
| 51 | + with: |
| 52 | + working-directory: examples/basic |
| 53 | + browser: ${{ matrix.browser }} |
| 54 | + |
| 55 | + docker-included: |
| 56 | + runs-on: ubuntu-22.04 |
| 57 | + strategy: |
| 58 | + fail-fast: false |
| 59 | + matrix: |
| 60 | + browser: [chrome, edge, firefox] |
| 61 | + # from https://hub.docker.com/r/cypress/included/tags |
| 62 | + container: |
| 63 | + # Examples use latest tag |
| 64 | + # For production use, to avoid the risk of breaking changes, |
| 65 | + # choose a fixed version tag from |
| 66 | + # https://hub.docker.com/r/cypress/included/tags |
| 67 | + image: cypress/included:latest |
| 68 | + options: --user 1001 |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + - uses: cypress-io/github-action@v6 |
| 72 | + with: |
| 73 | + # Using Cypress project with no Cypress version pre-installed |
| 74 | + working-directory: examples/basic-mini |
| 75 | + browser: ${{ matrix.browser }} |
| 76 | + env: |
| 77 | + # Cypress binary is already installed in cypress/included image |
| 78 | + # Use CYPRESS_INSTALL_BINARY=0 to prevent unneeded caching |
| 79 | + # which can cause errors with non-root user |
| 80 | + # see https://on.cypress.io/guides/references/advanced-installation#Skipping-installation |
| 81 | + CYPRESS_INSTALL_BINARY: 0 |
0 commit comments