ToolJet/.github/workflows/cypress.yml

54 lines
1.4 KiB
YAML

name: Cypress E2E Test
on:
pull_request_target:
types: [labeled, unlabeled, closed]
workflow_dispatch:
env:
PR_NUMBER: ${{ github.event.number }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
Run-Cypress:
if: ${{ github.event.action == 'labeled' && github.event.label.name == 'run-cypress' }}
runs-on: ubuntu-latest-4-cores
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup node 18.3.0
uses: actions/setup-node@v3
with:
node-version: 18.3.0
- name: Checking the PR URL
run: |
while true; do
curl --silent --fail http://13.57.209.185 && break
sleep 1
done
- name: Getting cypress secrets
# use quotes around the secret, as its value
# is simply inserted as a string into the command
run: |
echo '${{ secrets.CYPRESS_SECRETS }}' > cypress.env.json
- name: Cypress integration test
uses: cypress-io/github-action@v5
with:
working-directory: ./cypress-tests
config: "baseUrl=http://13.57.209.185"
config-file: cypress-run.config.js
- name: Capturing screenshots
uses: actions/upload-artifact@v2
if: always()
with:
name: screenshots
path: cypress-tests/cypress/screenshots