diff --git a/.github/workflows/e2e-validation.yml b/.github/workflows/e2e-validation.yml index 8a7db8fe71..8ed43cf30f 100644 --- a/.github/workflows/e2e-validation.yml +++ b/.github/workflows/e2e-validation.yml @@ -6,16 +6,17 @@ on: # - cron: '*/5 * * * *' # Runs every 5 minutes inputs: environment: - description: 'Select environment' - required: true - default: 'PROD' type: choice + required: true + description: "where to deploy" + default: "tools" options: - - PROD - - TOOLS + - tools + - production jobs: cypress-tests: + environment: ${{ inputs.environment }} runs-on: ubuntu-latest strategy: # don't fail the entire matrix on failure @@ -25,31 +26,13 @@ jobs: containers: [1] # , 2, 3, 4, 5, 6, 7, 8, 9, 10] - temp disabled mass steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: '18.18.2' - - name: Setup authentication for vite & other synthetic test variables - working-directory: app/web - run: | - sudo apt update - sudo apt install uuid -y - cp .env .env.local - echo "VITE_AUTH0_USERNAME=${{ secrets.VITE_AUTH0_USERNAME }}" >> .env.local - echo "VITE_AUTH0_PASSWORD=${{ secrets.VITE_AUTH0_PASSWORD }}" >> .env.local - echo "VITE_SI_CYPRESS_MULTIPLIER=${{ vars.VITE_SI_CYPRESS_MULTIPLIER }}" >> .env.local - if [ "${{ github.event.inputs.environment }}" == "PROD" ]; then - echo "VITE_SI_WORKSPACE_URL=${{ vars.VITE_PROD_SI_WORKSPACE_URL }}" >> .env.local - echo "VITE_SI_WORKSPACE_ID=${{ vars.VITE_PROD_SI_WORKSPACE_ID }}" >> .env.local - elif [ "${{ github.event.inputs.environment }}" == "TOOLS" ]; then - echo "VITE_SI_WORKSPACE_URL=${{ vars.VITE_TOOLS_SI_WORKSPACE_URL }}" >> .env.local - echo "VITE_SI_WORKSPACE_ID=${{ vars.VITE_TOOLS_SI_WORKSPACE_ID }}" >> .env.local - fi - echo "VITE_UUID=$(uuid)" >> .env.local - - name: Setup pnpm uses: pnpm/action-setup@v2 with: @@ -60,18 +43,25 @@ jobs: run: | pnpm i pnpm install cypress - + + - name: install uuid + run: | + sudo apt update + sudo apt install uuid -y + - uses: nick-fields/retry@v2 with: max_attempts: 3 timeout_minutes: 20 command: | - if [ "${{ github.event.inputs.environment }}" == "PROD" ]; then - export VITE_HOST_URL=${{ vars.VITE_PROD_SI_WORKSPACE_URL }} - elif [ "${{ github.event.inputs.environment }}" == "TOOLS" ]; then - export VITE_HOST_URL=${{ vars.VITE_TOOLS_SI_WORKSPACE_URL }} - fi cd app/web + export VITE_AUTH0_USERNAME=${{ secrets.VITE_AUTH0_USERNAME }} + export VITE_AUTH0_PASSWORD=${{ secrets.VITE_AUTH0_PASSWORD }},\ + export VITE_SI_CYPRESS_MULTIPLIER=${{ vars.VITE_SI_CYPRESS_MULTIPLIER }} + export VITE_SI_WORKSPACE_URL=${{ vars.VITE_SI_WORKSPACE_URL }} + export VITE_HOST_URL=${{ vars.VITE_SI_WORKSPACE_URL }} + export VITE_SI_WORKSPACE_ID=${{ vars.VITE_SI_WORKSPACE_ID }} + export VITE_UUID=$(uuid) npx cypress run --spec "cypress/e2e/**" - name: 'Upload Cypress Recordings to Github'