-
-
Notifications
You must be signed in to change notification settings - Fork 173
137 lines (119 loc) · 4.04 KB
/
integration.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
# To upgrade pinned actions: Use https://github.com/mheap/pin-github-action
name: CI - Integration
on:
push:
branches-ignore:
- "main"
- "release/**"
paths:
- "**"
- "!.github/**"
- ".github/workflows/integration.yml"
- "!.tx/**"
- "!.vscode/**"
- "!assets/**"
- "!panel/scripts/**"
- "!scripts/**"
pull_request:
branches-ignore:
- "main"
- "release/**"
paths:
- "**"
- "!.github/**"
- ".github/workflows/integration.yml"
- "!.tx/**"
- "!.vscode/**"
- "!assets/**"
- "!panel/scripts/**"
- "!scripts/**"
workflow_call:
jobs:
e2e:
name: "E2E tests"
# if on pull request, only run if from a fork
# (our own repo is covered by the push event)
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
timeout-minutes: 5
env:
php: "8.0"
extensions: mbstring, ctype, curl, gd, apcu, memcached
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3
with:
path: kirby
- name: Checkout Sandbox
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3
with:
repository: getkirby/sandbox
path: sandbox
submodules: true
- name: Preparations
run: |
# set up log directory
mkdir -p ${{ github.workspace }}/_logs
# link Kirby to Sandbox
rm -rf ${{ github.workspace }}/sandbox/kirby
ln -s ${{ github.workspace }}/kirby ${{ github.workspace }}/sandbox/kirby
- name: Setup PHP cache environment
id: ext-cache
uses: shivammathur/cache-extensions@de71cbc3239d9b69ea8558b8609ccd067ab4cf14 # pin@v1
with:
php-version: ${{ env.php }}
extensions: ${{ env.extensions }}
key: e2e-v1
- name: Cache PHP extensions
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # pin@v3
with:
path: ${{ steps.ext-cache.outputs.dir }}
key: ${{ steps.ext-cache.outputs.key }}
restore-keys: ${{ steps.ext-cache.outputs.key }}
- name: Setup PHP environment
uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # pin@v2
with:
php-version: ${{ env.php }}
extensions: ${{ env.extensions }}
coverage: none
- name: Install dependencies
uses: cypress-io/github-action@327178c8042fbb3be13870105eece3c8abf348c9 # pin@v5
with:
working-directory: kirby/panel
runTests: false
- name: Build Panel dist files
run: npm run build
working-directory: kirby/panel
- name: Start the PHP server
run: php -S 127.0.0.1:8000 -t ${{ github.workspace }}/sandbox/public ${{ github.workspace }}/sandbox/router.php &> ${{ github.workspace }}/_logs/php.log &
working-directory: kirby/panel
- name: Run tests
uses: cypress-io/github-action@327178c8042fbb3be13870105eece3c8abf348c9 # pin@v5
with:
working-directory: kirby/panel
install: false
wait-on: "http://127.0.0.1:8000/panel/login"
wait-on-timeout: 5
config: baseUrl=http://127.0.0.1:8000
- name: Print log files
if: always()
run: |
for log in ${{ github.workspace }}/_logs/*; do
echo "::group::$(basename $log)"
cat $log
echo "::endgroup::"
done
- name: Archive Cypress screenshots
if: failure()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v3
with:
name: cypress-screenshots
path: kirby/panel/cypress/screenshots
- name: Archive Cypress videos
if: always()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v3
with:
name: cypress-videos
path: kirby/panel/cypress/videos