ToolJet/.github/workflows/cypress.yml
Akshay f464f39bfe
Merge pull request #6081 from ToolJet/git-hub-runner
Testing self-hosted runner for actions
2023-04-20 17:49:33 +05:30

54 lines
1.5 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: self-hosted
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
- name: Capturing screenshots
uses: actions/upload-artifact@v3
if: always()
with:
name: screenshots
path: cypress-tests/cypress/screenshots