-
-
Notifications
You must be signed in to change notification settings - Fork 84
151 lines (139 loc) · 4.76 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
name: Acceptance Tests
on:
pull_request:
branches:
- "**"
push:
branches:
- "main"
jobs:
Acceptance:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
typo3:
- ^12.4
php:
- '8.1'
- '8.2'
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@v3
- uses: jonaseberle/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 }}
ddev exec sudo apt remove -y php${{ matrix.php }}-uploadprogress
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@v2
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 }}'
# Non Composer is commented out for now, till I find a better way to run them, the are failing more than not, so they
# don't bring much value atm as they are often ignored. I know not good, but none the less the case.
# NonComposer:
# runs-on: self-hosted
# strategy:
# fail-fast: false
# matrix:
# typo3:
# - 'v11'
# - 'v11p80'
#
# steps:
# - uses: shivammathur/setup-php@v2
# with:
# php-version: '8.1'
# tools: composer:v2
# coverage: none
#
# - name: Version information
# run: |
# php -v
# composer --version
#
# - uses: actions/checkout@v3
# - run: |
# cd .devbox/.ddev
# docker-compose -f docker-compose.selenium.yaml up -d
# cd ../.. # Going back to "root" directory
# rm -rf .Build composer.lock
# composer require nimut/typo3-complete:^11.5
# 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 localhost:4444
# php .Build/bin/codecept run --env=${{ matrix.typo3 }}-non-composer
#
# - name: Upload Codeception output
# if: ${{ failure() }}
# uses: actions/upload-artifact@v2
# 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 }}-non-composer'
#