-
Notifications
You must be signed in to change notification settings - Fork 50
84 lines (70 loc) · 2.4 KB
/
qit-e2e.yml
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
name: QIT E2E tests
on:
pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
name: QIT E2E tests
steps:
- name: Checkout repo
uses: actions/checkout@v4
# PHP
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer
coverage: none
# Node
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Cache Node deps
id: node-cache
uses: actions/cache@v4
with:
path: |
./node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
# Build
- name: Build plugin package
shell: bash
run: |
npm run build
- name: Install composer dependencies
shell: bash
run: composer install --no-progress
- name: Add partner for QIT
run: ./vendor/bin/qit partner:add --user='${{ secrets.PARTNER_USER }}' --application_password='${{ secrets.PARTNER_SECRET }}'
# E2E test environment
- name: Fill in .env
run: |
echo 'PAYPAL_MERCHANT_ID="${{ secrets.PAYPAL_MERCHANT_ID }}"' >> .env
echo 'PAYPAL_MERCHANT_EMAIL="${{ secrets.PAYPAL_MERCHANT_EMAIL }}"' >> .env
echo 'PAYPAL_CLIENT_ID="${{ secrets.PAYPAL_CLIENT_ID }}"' >> .env
echo 'PAYPAL_CLIENT_SECRET="${{ secrets.PAYPAL_CLIENT_SECRET }}"' >> .env
echo 'PAYPAL_CUSTOMER_EMAIL="${{ secrets.PAYPAL_CUSTOMER_EMAIL }}"' >> .env
echo 'PAYPAL_CUSTOMER_PASSWORD="${{ secrets.PAYPAL_CUSTOMER_PASSWORD }}"' >> .env
echo 'STRIPE_PUB_KEY="${{ secrets.STRIPE_PUB_KEY }}"' >> .env
echo 'STRIPE_SECRET_KEY="${{ secrets.STRIPE_SECRET_KEY }}"' >> .env
- name: Run E2E tests
shell: bash
run: npm run test:e2e -- --env_file .env --plugin woocommerce-gateway-stripe:bootstrap
- name: Set the path in an env var
if: ${{ failure() }}
run: echo "E2E_REPORT_PATH=$(./vendor/bin/qit e2e-report --dir_only --local)/playwright" >> $GITHUB_ENV
- name: Upload E2E test results
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: E2E-test-results
path: ${{ env.E2E_REPORT_PATH }}
if-no-files-found: ignore
retention-days: 2