-
-
Notifications
You must be signed in to change notification settings - Fork 85
161 lines (148 loc) · 5.29 KB
/
Acceptance.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Acceptance Tests
on:
pull_request:
branches:
- "**"
push:
branches:
- "main"
jobs:
Acceptance-CodeCeption:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
typo3:
- ^12.4
php:
- '8.1'
- '8.2'
- '8.3'
steps:
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
- name: Version information
run: |
php -v
composer --version
- uses: actions/checkout@v4
- uses: ddev/github-action-setup-ddev@v1
with:
ddevDir: ".devbox"
- name: CodeCeption
run: |
export FROM_PATH='../../'
export TO_PATH=$(echo $GITHUB_WORKSPACE)
cd .devbox
sed -i 's/php_version: "8.1"/php_version: "${{ matrix.php }}"/g' .ddev/config.yaml
sed -i "s|$FROM_PATH|$TO_PATH|g" .ddev/docker-compose.volume.yaml
ddev restart
rm -rf vendor composer.lock
ddev composer require typo3/cms-core=${{ matrix.typo3 }} tomasnorre/crawler=dev-$BRANCH_NAME georgringer/news
ddev exec bin/typo3 backend:lock
ddev exec bin/typo3 extension:setup
ddev exec bin/typo3 cache:flush
ddev exec bin/typo3 cache:warmup
ddev exec bin/typo3 upgrade:run
ddev exec bin/typo3 backend:unlock
cd .. # Going back to "root" directory
rm -rf .Build composer.lock
composer require typo3/cms-core=${{ matrix.typo3 }}
wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
chmod +x wait-for-it.sh
docker ps
./wait-for-it.sh -t 60 127.0.0.1:80
./wait-for-it.sh -t 60 127.0.0.1:443
./wait-for-it.sh -t 60 localhost:4444
php .Build/bin/codecept run
- name: Database Dump
if: ${{ failure() }}
run: |
cd .devbox
ddev export-db --gzip=false --file=../Tests/Acceptance/_output/db.sql
- name: Upload Codeception output
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: codeception-results
path: Tests/Acceptance/_output/
- uses: shallwefootball/s3-upload-action@master
if: ${{ failure() }}
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ secrets.AWS_BUCKET }}
source_dir: 'Tests/Acceptance/_output/'
destination_dir: '${{ matrix.typo3 }}-${{ matrix.php }}'
Acceptance-Playwright:
strategy:
fail-fast: false
matrix:
typo3:
- ^13.4
php:
- '8.2'
- '8.3'
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: ddev/github-action-setup-ddev@v1
with:
ddevDir: ".devbox"
- name: CodeCeption
run: |
export FROM_PATH='../../'
export TO_PATH=$(echo $GITHUB_WORKSPACE)
cd .devbox
sed -i 's/php_version: "8.1"/php_version: "${{ matrix.php }}"/g' .ddev/config.yaml
sed -i "s|$FROM_PATH|$TO_PATH|g" .ddev/docker-compose.volume.yaml
ddev restart
rm -rf vendor composer.lock
ddev composer require typo3/cms-core=${{ matrix.typo3 }} tomasnorre/crawler=dev-$BRANCH_NAME
ddev exec bin/typo3 backend:lock
ddev exec bin/typo3 extension:setup
ddev exec bin/typo3 cache:flush
ddev exec bin/typo3 cache:warmup
ddev exec bin/typo3 upgrade:run
ddev exec bin/typo3 backend:unlock
cd .. # Going back to "root" directory
wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
chmod +x wait-for-it.sh
docker ps
./wait-for-it.sh -t 60 127.0.0.1:80
./wait-for-it.sh -t 60 127.0.0.1:443
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: cd Tests/Acceptance-Playwright && npm ci
- name: Install Playwright Browsers
run: cd Tests/Acceptance-Playwright && npx playwright install --with-deps
- name: Run Playwright tests
run: cd Tests/Acceptance-Playwright && npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30