|
16 | 16 | PASSWORD: ${{ secrets.PASSWORD }} |
17 | 17 |
|
18 | 18 | jobs: |
19 | | - test: |
| 19 | + critical-test-run: |
20 | 20 | timeout-minutes: 60 |
21 | 21 | runs-on: ubuntu-latest |
22 | 22 | strategy: |
@@ -47,25 +47,122 @@ jobs: |
47 | 47 | github_token: ${{ secrets.GITHUB_TOKEN }} |
48 | 48 | publish_dir: playwright-report/ |
49 | 49 |
|
50 | | - status_checks: |
51 | | - name: E2E status checks |
| 50 | + regression-test-run: |
| 51 | + timeout-minutes: 60 |
| 52 | + runs-on: ubuntu-latest |
| 53 | + needs: critical-test-run |
| 54 | + strategy: |
| 55 | + fail-fast: false |
| 56 | + matrix: |
| 57 | + browsers: ['chromium'] |
| 58 | + greps: ['@LOGIN', '@SIGN_UP', '@SANITY', '@MEN_CATEGORY_SHOP'] |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v4 |
| 61 | + - uses: actions/setup-node@v4 |
| 62 | + with: |
| 63 | + node-version: lts/* |
| 64 | + - name: Install dependencies |
| 65 | + run: npm ci |
| 66 | + - name: Install Playwright Browsers |
| 67 | + run: npx playwright install --with-deps |
| 68 | + - name: Run Playwright tests |
| 69 | + run: BASE_URL=${{ env.BASE_URL }} npx playwright test --grep ${{ matrix.greps }} --project=${{ matrix.browsers }} |
| 70 | + - uses: actions/upload-artifact@v4 |
| 71 | + if: always() |
| 72 | + with: |
| 73 | + name: playwright-report-${{ github.job }} |
| 74 | + path: playwright-report/ |
| 75 | + retention-days: 30 |
| 76 | + - name: Deploy Playwright report to GitHub Pages |
| 77 | + uses: peaceiris/actions-gh-pages@v3 |
| 78 | + with: |
| 79 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 80 | + publish_dir: playwright-report/ |
| 81 | + |
| 82 | + sanity-test-run: |
| 83 | + timeout-minutes: 60 |
52 | 84 | runs-on: ubuntu-latest |
53 | | - if: ${{ github.event_name == 'pull_request' }} |
54 | | - needs: test |
| 85 | + needs: |
| 86 | + - critical-test-run |
| 87 | + - regression-test-run |
| 88 | + strategy: |
| 89 | + fail-fast: false |
| 90 | + matrix: |
| 91 | + browsers: ['chromium'] |
| 92 | + greps: ['@LOGIN', '@SIGN_UP', '@SANITY', '@MEN_CATEGORY_SHOP'] |
55 | 93 | steps: |
56 | | - - name: determine status check conclusion |
57 | | - id: status-check-status |
58 | | - run: | |
59 | | - if [[ "${{ needs.test.result == 'failure' }}" ]]; then |
60 | | - echo "status=failure" >> $GITHUB_OUTPUT |
61 | | - else |
62 | | - echo "status=success" >> $GITHUB_OUTPUT |
63 | | - fi |
64 | | - - name: set pr status checks |
65 | | - uses: teamniteo/pull_request_status_action@v1.0.0 |
66 | | - with: |
67 | | - pr_number: ${{ github.event.pull_request.number }} |
68 | | - state: ${{ steps.status-check-status.outputs.status }} |
69 | | - repository: Romarionijim/Playwright-TypeScript-Mini-Project |
70 | | - env: |
71 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 94 | + - uses: actions/checkout@v4 |
| 95 | + - uses: actions/setup-node@v4 |
| 96 | + with: |
| 97 | + node-version: lts/* |
| 98 | + - name: Install dependencies |
| 99 | + run: npm ci |
| 100 | + - name: Install Playwright Browsers |
| 101 | + run: npx playwright install --with-deps |
| 102 | + - name: Run Playwright tests |
| 103 | + run: BASE_URL=${{ env.BASE_URL }} npx playwright test --grep ${{ matrix.greps }} --project=${{ matrix.browsers }} |
| 104 | + - uses: actions/upload-artifact@v4 |
| 105 | + if: always() |
| 106 | + with: |
| 107 | + name: playwright-report-${{ github.job }} |
| 108 | + path: playwright-report/ |
| 109 | + retention-days: 30 |
| 110 | + - name: Deploy Playwright report to GitHub Pages |
| 111 | + uses: peaceiris/actions-gh-pages@v3 |
| 112 | + with: |
| 113 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 114 | + publish_dir: playwright-report/ |
| 115 | + regression-test-run: |
| 116 | + timeout-minutes: 60 |
| 117 | + runs-on: ubuntu-latest |
| 118 | + needs: critical-test-run |
| 119 | + strategy: |
| 120 | + fail-fast: false |
| 121 | + matrix: |
| 122 | + browsers: ['chromium'] |
| 123 | + greps: ['@LOGIN', '@SIGN_UP', '@SANITY', '@MEN_CATEGORY_SHOP'] |
| 124 | + steps: |
| 125 | + - uses: actions/checkout@v4 |
| 126 | + - uses: actions/setup-node@v4 |
| 127 | + with: |
| 128 | + node-version: lts/* |
| 129 | + - name: Install dependencies |
| 130 | + run: npm ci |
| 131 | + - name: Install Playwright Browsers |
| 132 | + run: npx playwright install --with-deps |
| 133 | + - name: Run Playwright tests |
| 134 | + run: BASE_URL=${{ env.BASE_URL }} npx playwright test --grep ${{ matrix.greps }} --project=${{ matrix.browsers }} |
| 135 | + - uses: actions/upload-artifact@v4 |
| 136 | + if: always() |
| 137 | + with: |
| 138 | + name: playwright-report-${{ github.job }} |
| 139 | + path: playwright-report/ |
| 140 | + retention-days: 30 |
| 141 | + - name: Deploy Playwright report to GitHub Pages |
| 142 | + uses: peaceiris/actions-gh-pages@v3 |
| 143 | + with: |
| 144 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 145 | + publish_dir: playwright-report/ |
| 146 | + |
| 147 | + # status_checks: |
| 148 | + # name: E2E status checks |
| 149 | + # runs-on: ubuntu-latest |
| 150 | + # if: ${{ github.event_name == 'pull_request' }} |
| 151 | + # needs: test |
| 152 | + # steps: |
| 153 | + # - name: determine status check conclusion |
| 154 | + # id: status-check-status |
| 155 | + # run: | |
| 156 | + # if [[ "${{ needs.test.result == 'failure' }}" ]]; then |
| 157 | + # echo "status=failure" >> $GITHUB_OUTPUT |
| 158 | + # else |
| 159 | + # echo "status=success" >> $GITHUB_OUTPUT |
| 160 | + # fi |
| 161 | + # - name: set pr status checks |
| 162 | + # uses: teamniteo/pull_request_status_action@v1.0.0 |
| 163 | + # with: |
| 164 | + # pr_number: ${{ github.event.pull_request.number }} |
| 165 | + # state: ${{ steps.status-check-status.outputs.status }} |
| 166 | + # repository: Romarionijim/Playwright-TypeScript-Mini-Project |
| 167 | + # env: |
| 168 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments