forked from stellarwp/kadence-blocks
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (82 loc) · 3.1 KB
/
Copy pathe2e.yml
File metadata and controls
98 lines (82 loc) · 3.1 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
name: E2E test
on:
push:
branches:
- develop
- main
pull_request:
workflow_call:
jobs:
e2e:
runs-on: ubuntu-latest
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.COMPOSER_TOKEN }}"}}'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout slic
uses: actions/checkout@v4
with:
repository: stellarwp/slic
ref: main
path: slic
fetch-depth: 1
- name: Cache Composer dependencies
uses: actions/cache@v4
id: composer-cache
with:
path: ~/.cache/composer
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Set up slic env vars
run: |
echo "SLIC_BIN=${GITHUB_WORKSPACE}/slic/slic" >> $GITHUB_ENV
echo "SLIC_WP_DIR=${GITHUB_WORKSPACE}/slic/_wordpress" >> $GITHUB_ENV
echo "SLIC_WORDPRESS_DOCKERFILE=Dockerfile.base" >> $GITHUB_ENV
- name: Set run context for slic
run: echo "SLIC=1" >> $GITHUB_ENV && echo "CI=1" >> $GITHUB_ENV
- name: Start ssh-agent
run: |
mkdir -p "${HOME}/.ssh"
ssh-agent -a /tmp/ssh_agent.sock
- name: Export SSH_AUTH_SOCK env var
run: echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV
- name: Set up slic for CI
run: |
cd ${GITHUB_WORKSPACE}/..
${SLIC_BIN} here
${SLIC_BIN} interactive off
${SLIC_BIN} build-prompt off
${SLIC_BIN} build-subdir off
${SLIC_BIN} xdebug off
${SLIC_BIN} debug on
${SLIC_BIN} info
${SLIC_BIN} config
- name: Install & Build Plugin
run: |
cd "$GITHUB_WORKSPACE"
composer install --no-dev --no-scripts
composer run strauss-release
npm install --legacy-peer-deps
npm run build
- name: Start slic stack
run: |
${SLIC_BIN} use "$(basename "$GITHUB_WORKSPACE")"
${SLIC_BIN} up
${SLIC_BIN} playwright install chromium
${SLIC_BIN} site-cli
${SLIC_BIN} wp plugin activate "$(basename "$GITHUB_WORKSPACE")"
- name: Run E2E Test
run: ${SLIC_BIN} playwright test --config tests/e2e/playwright.config.js
- uses: actions/upload-artifact@v4
if: always()
with:
name: E2E Test Report
path: tests/e2e/test-results
retention-days: 7