-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (129 loc) · 4.15 KB
/
ci.yml
File metadata and controls
137 lines (129 loc) · 4.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: ci pipeline
on:
# push:
# branches:
# - "*"
pull_request:
branches: [ main, master ]
workflow_dispatch:
env:
BASE_URL: 'https://magento.softwaretestingboard.com/'
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
jobs:
critical-test-run:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browsers: ['chromium']
greps: ['@LOGIN', '@SIGN_UP', '@SANITY', '@MEN_CATEGORY_SHOP']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: BASE_URL=${{ env.BASE_URL }} npx playwright test --grep ${{ matrix.greps }} --project=${{ matrix.browsers }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ github.job }}
path: playwright-report/
retention-days: 30
- name: Deploy Playwright report to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: playwright-report/
regression-test-run:
timeout-minutes: 60
runs-on: ubuntu-latest
needs: critical-test-run
strategy:
fail-fast: false
matrix:
browsers: ['chromium']
greps: ['@LOGIN', '@SIGN_UP', '@SANITY', '@MEN_CATEGORY_SHOP']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: BASE_URL=${{ env.BASE_URL }} npx playwright test --grep ${{ matrix.greps }} --project=${{ matrix.browsers }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ github.job }}
path: playwright-report/
retention-days: 30
- name: Deploy Playwright report to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: playwright-report/
sanity-test-run:
timeout-minutes: 60
runs-on: ubuntu-latest
needs:
- critical-test-run
- regression-test-run
strategy:
fail-fast: false
matrix:
browsers: ['chromium']
greps: ['@LOGIN', '@SIGN_UP', '@SANITY', '@MEN_CATEGORY_SHOP']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: BASE_URL=${{ env.BASE_URL }} npx playwright test --grep ${{ matrix.greps }} --project=${{ matrix.browsers }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ github.job }}
path: playwright-report/
retention-days: 30
- name: Deploy Playwright report to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: playwright-report/
# status_checks:
# name: E2E status checks
# runs-on: ubuntu-latest
# if: ${{ github.event_name == 'pull_request' }}
# needs: test
# steps:
# - name: determine status check conclusion
# id: status-check-status
# run: |
# if [[ "${{ needs.test.result == 'failure' }}" ]]; then
# echo "status=failure" >> $GITHUB_OUTPUT
# else
# echo "status=success" >> $GITHUB_OUTPUT
# fi
# - name: set pr status checks
# uses: teamniteo/pull_request_status_action@v1.0.0
# with:
# pr_number: ${{ github.event.pull_request.number }}
# state: ${{ steps.status-check-status.outputs.status }}
# repository: Romarionijim/Playwright-TypeScript-Mini-Project
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}