-
Notifications
You must be signed in to change notification settings - Fork 76
141 lines (139 loc) · 5.61 KB
/
E2E_SFRA.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
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
138
139
140
141
name: E2E For SFRA
on:
pull_request:
paths-ignore:
- 'int_adyen_controllers/**'
- 'adyen_controllers_changes/**'
jobs:
setup-the-cartridge:
if: ${{ github.actor != 'renovate[bot]' || github.actor != 'lgtm-com[bot]' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- sfra-version: 'v5.3.0'
node-version: '14'
sfcc-hostname-secret: 'SFCC_HOSTNAME_SFRA5'
code-version-secret: 'SFCC_CODE_VERSION_SFRA5'
- sfra-version: 'v6.1.0'
node-version: '14'
sfcc-hostname-secret: 'SFCC_HOSTNAME_SFRA6'
code-version-secret: 'SFCC_CODE_VERSION_SFRA6'
- sfra-version: 'v7.0.0'
node-version: '18'
sfcc-hostname-secret: 'SFCC_HOSTNAME_SFRA7'
code-version-secret: 'SFCC_CODE_VERSION_SFRA7'
steps:
- name: Checkout SFRA code
uses: actions/checkout@v4
with:
repository: SalesforceCommerceCloud/storefront-reference-architecture
ref: ${{ matrix.sfra-version }}
ssh-key: ${{ secrets.SERVICE_ACCOUNT_SSH_KEY }}
path: storefront-reference-architecture
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Checkout
uses: actions/checkout@v4
with:
path: adyen-salesforce-commerce-cloud
- name: Install SFRA dependencies
working-directory: storefront-reference-architecture
run: npm install
- name: Install Adyen SFCC dependencies
working-directory: adyen-salesforce-commerce-cloud
run: npm install
- name: Create dw.json file
working-directory: adyen-salesforce-commerce-cloud
run: |
echo '{
"username": "${{ secrets.SFCC_USERNAME }}",
"password": "${{ secrets.SFCC_PASSWORD }}",
"hostname": "${{ secrets[matrix.sfcc-hostname-secret] }}",
"code-version": "${{ secrets[matrix.code-version-secret] }}"
}' >> dw.json
- name: Transpile the code
working-directory: adyen-salesforce-commerce-cloud
run: npm run transpile
- name: Compile the code
working-directory: adyen-salesforce-commerce-cloud
run: npm run compile:js
- name: Build the cartridge
working-directory: adyen-salesforce-commerce-cloud
run: npm run uploadCartridge > output-sfra.txt
- name: Check build result
working-directory: adyen-salesforce-commerce-cloud
run: npm run check-build:sfra
end-to-end-testing:
if: ${{ github.actor != 'renovate[bot]' || github.actor != 'lgtm-com[bot]' }}
needs: setup-the-cartridge
runs-on:
group: larger-runners
labels: ubuntu-latest-8-cores
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- sfra-version: 'v5.3.0'
node-version: '16'
sfcc-hostname-secret: 'SFCC_STOREFRONT_URL_SFRA5'
code-version-secret: 'SFCC_CODE_VERSION_SFRA5'
- sfra-version: 'v6.1.0'
node-version: '16'
sfcc-hostname-secret: 'SFCC_STOREFRONT_URL_SFRA6'
code-version-secret: 'SFCC_CODE_VERSION_SFRA6'
- sfra-version: 'v7.0.0'
node-version: '18'
sfcc-hostname-secret: 'SFCC_STOREFRONT_URL_SFRA7'
code-version-secret: 'SFCC_CODE_VERSION_SFRA7'
steps:
- name: setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Checkout
uses: actions/checkout@v4
with:
path: adyen-salesforce-commerce-cloud
- name: install e2e test dependencies
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
run: npm i
- name: setup playwright dependencies
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
run: npx playwright install --with-deps
- name: run e2e tests full coverage
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
if: github.event.pull_request.base.ref == 'main'
run: npm run test:ci
env:
SANDBOX_HTTP_AUTH_USERNAME: ${{ secrets.SANDBOX_HTTP_AUTH_USERNAME }}
SANDBOX_HTTP_AUTH_PASSWORD: ${{ secrets.SANDBOX_HTTP_AUTH_PASSWORD }}
PAYPAL_USERNAME: ${{ secrets.PAYPAL_USERNAME }}
PAYPAL_PASSWORD: ${{ secrets.PAYPAL_PASSWORD }}
AMAZONPAY_USERNAME: ${{ secrets.AMAZONPAY_USERNAME }}
AMAZONPAY_PASSWORD: ${{ secrets.AMAZONPAY_PASSWORD }}
SFRA_VERSION: ${{ matrix.sfra-version }}
SFCC_HOSTNAME: ${{ secrets[matrix.sfcc-hostname-secret] }}
- name: run e2e tests quick coverage
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
if: github.event.pull_request.base.ref != 'main'
run: npm run test:ci:quick
env:
SANDBOX_HTTP_AUTH_USERNAME: ${{ secrets.SANDBOX_HTTP_AUTH_USERNAME }}
SANDBOX_HTTP_AUTH_PASSWORD: ${{ secrets.SANDBOX_HTTP_AUTH_PASSWORD }}
PAYPAL_USERNAME: ${{ secrets.PAYPAL_USERNAME }}
PAYPAL_PASSWORD: ${{ secrets.PAYPAL_PASSWORD }}
AMAZONPAY_USERNAME: ${{ secrets.AMAZONPAY_USERNAME }}
AMAZONPAY_PASSWORD: ${{ secrets.AMAZONPAY_PASSWORD }}
SFRA_VERSION: ${{ matrix.sfra-version }}
SFCC_HOSTNAME: ${{ secrets[matrix.sfcc-hostname-secret] }}
- name: Archive test result artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report
path: playwright-report