Run test manually #398
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run test manually | |
| on: [workflow_dispatch] | |
| concurrency: | |
| group: ${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| initialize-cloud: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| POOL_NAME: ${{ steps.pool_variables.outputs.POOL_NAME }} | |
| POOL_INSTANCE: ${{ steps.pool_variables.outputs.POOL_INSTANCE }} | |
| BASE_URL: ${{ steps.cloud_variables.outputs.BASE_URL }} | |
| API_URL: ${{ steps.cloud_variables.outputs.API_URL }} | |
| BACKUP_ID: ${{ steps.cloud_variables.outputs.BACKUP_ID }} | |
| BACKUP_VER: ${{ steps.cloud_variables.outputs.BACKUP_VER }} | |
| BACKUP_NAME: ${{ steps.cloud_variables.outputs.BACKUP_NAME }} | |
| ACCOUNTS: ${{ steps.accounts.outputs.ACCOUNTS }} | |
| SALEOR_CLOUD_SERVICE: ${{ steps.cloud_variables.outputs.SALEOR_CLOUD_SERVICE }} | |
| RUN_SLUG: ${{ steps.cloud_variables.outputs.RUN_SLUG }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version-file: ".nvmrc" | |
| - name: Cache node modules | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-qa-${{ env.cache-name }}- | |
| ${{ runner.os }}-qa- | |
| ${{ runner.os }}- | |
| - name: Install deps | |
| run: npm ci | |
| - name: Set variables mode | |
| id: set_variables_mode | |
| shell: bash | |
| run: | | |
| if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then | |
| echo "MODE=main" >> $GITHUB_OUTPUT | |
| else | |
| echo "MODE=release" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Load secrets for initialize-cloud | |
| uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 # v2.0.0 | |
| id: load-secrets-init | |
| with: | |
| export-env: true | |
| env: | |
| OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
| STAGING_TOKEN: "op://Continuous Integration/CLOUD_STAGING_TOKEN/password" | |
| - name: Generate variables | |
| id: cloud_variables | |
| uses: ./.github/actions/prepare-tests-variables | |
| with: | |
| CLI_TOKEN: ${{ env.STAGING_TOKEN }} | |
| MODE: ${{ steps.set_variables_mode.outputs.MODE }} | |
| - name: Prepare instances | |
| id: pool_variables | |
| uses: ./.github/actions/prepare-instance | |
| with: | |
| STRATEGY: reload | |
| CLI_TOKEN: ${{ env.STAGING_TOKEN }} | |
| BASE_URL: ${{ steps.cloud_variables.outputs.BASE_URL }} | |
| API_URL: ${{ steps.cloud_variables.outputs.API_URL }} | |
| POOL_NAME: ${{ steps.cloud_variables.outputs.POOL_NAME }} | |
| POOL_INSTANCE: ${{ steps.cloud_variables.outputs.POOL_INSTANCE }} | |
| BACKUP_ID: ${{ steps.cloud_variables.outputs.BACKUP_ID }} | |
| SALEOR_CLOUD_SERVICE: ${{ steps.cloud_variables.outputs.SALEOR_CLOUD_SERVICE }} | |
| - name: Prepare accounts | |
| id: accounts | |
| uses: ./.github/actions/prepare-accounts | |
| with: | |
| BASE_URL: ${{ steps.cloud_variables.outputs.BASE_URL }} | |
| API_URL: ${{ steps.cloud_variables.outputs.API_URL }} | |
| E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }} | |
| E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }} | |
| E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }} | |
| E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }} | |
| run-tests: | |
| runs-on: ubuntu-22.04 | |
| needs: ["initialize-cloud"] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: [1/2, 2/2] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run playwright tests | |
| uses: ./.github/actions/run-pw-tests | |
| with: | |
| SHARD: ${{ matrix.shard }} | |
| BASE_URL: ${{ needs.initialize-cloud.outputs.BASE_URL }} | |
| API_URL: ${{ needs.initialize-cloud.outputs.API_URL }} | |
| E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }} | |
| E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }} | |
| E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }} | |
| E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }} | |
| ACCOUNTS: ${{ needs.initialize-cloud.outputs.ACCOUNTS }} | |
| MAILPITURL: ${{ secrets.MAILPITURL }} | |
| PW_WORKERS: ${{ vars.PW_WORKERS }} | |
| PW_RETRIES: ${{ vars.PW_RETRIES }} | |
| ENABLED_SERVICE_NAME_HEADER: true | |
| URL_TO_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| PROJECT: "e2e apps-e2e" | |
| DASHBOARD_VERSION: ${{ needs.initialize-cloud.outputs.RUN_SLUG }} | |
| BRANCH_NAME: ${{ github.ref}} | |
| SALEOR_CLOUD_SERVICE: ${{ needs.initialize-cloud.outputs.SALEOR_CLOUD_SERVICE }} | |
| BUILD_NUMBER: ${{ github.run_id }} | |
| BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| tests-complete: | |
| if: "!cancelled()" | |
| needs: ["initialize-cloud", "run-tests"] | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Load secrets | |
| uses: 1password/load-secrets-action@581a835fb51b8e7ec56b71cf2ffddd7e68bb25e0 # v2.0.0 | |
| id: load-secrets | |
| with: | |
| # Export loaded secrets as environment variables | |
| export-env: true | |
| env: | |
| OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
| SLACK_WEBHOOK_URL: "op://Continuous Integration/CTRF_SLACK_REPORT/password" | |
| - name: Merge playwright reports | |
| uses: ./.github/actions/merge-pw-reports | |
| with: | |
| PASSWORD_FOR_DECODING_ARTIFACT: ${{ secrets.TESTS_RESULT_PASSWORD }} | |
| - name: Create flaky report | |
| uses: ./.github/actions/flaky-tests-report | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| ctrf_slack_report_webhook: ${{ steps.load-secrets.outputs.SLACK_WEBHOOK_URL }} | |
| - name: Push flaky report | |
| uses: ./.github/actions/push-flaky-test-report | |
| with: | |
| VAULT_URL: ${{ secrets.VAULT_URL }} | |
| VAULT_JWT: ${{ secrets.VAULT_JWT }} |