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-22.04 steps: - name: Checkout uses: actions/checkout@v3 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 https://tooljet-pr-${{ env.PR_NUMBER }}.onrender.com && 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=https://tooljet-pr-${{ env.PR_NUMBER }}.onrender.com" config-file: cypress-run.config.js env: ${{ secrets.CYPRESS_SECRETS }} - name: Capturing screenshots uses: actions/upload-artifact@v3 if: always() with: name: screenshots path: cypress-tests/cypress/screenshots - name: Capturing downloads uses: actions/upload-artifact@v3 if: always() with: name: screenshots path: cypress-tests/cypress/downloads