Skip to content

Commit f04c67d

Browse files
authored
Merge pull request #7002 from codeigniter4/develop
4.2.11 Ready code
2 parents 9d95248 + f9fb657 commit f04c67d

File tree

260 files changed

+3163
-1351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+3163
-1351
lines changed

.github/scripts/deploy-appstarter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ git checkout master
2020
rm -rf *
2121

2222
# Copy common files
23-
releasable='app public writable env LICENSE spark'
23+
releasable='app public writable env LICENSE spark preload.php'
2424
for fff in $releasable;
2525
do
2626
cp -Rf ${SOURCE}/$fff ./

.github/scripts/deploy-framework

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ git checkout master
2020
rm -rf *
2121

2222
# Copy common files
23-
releasable='app public writable env LICENSE spark system'
23+
releasable='app public writable env LICENSE spark system preload.php'
2424
for fff in $releasable;
2525
do
2626
cp -Rf ${SOURCE}/$fff ./
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Reusable Coveralls Upload
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
php-version:
7+
description: The PHP version the workflow should run
8+
type: string
9+
required: true
10+
11+
jobs:
12+
coveralls:
13+
runs-on: ubuntu-22.04
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: ${{ inputs.php-version }}
23+
tools: composer
24+
coverage: xdebug
25+
26+
- name: Download coverage files
27+
uses: actions/download-artifact@v3
28+
with:
29+
path: build/cov
30+
31+
- name: Display structure of downloaded files
32+
run: ls -R
33+
working-directory: build/cov
34+
35+
- name: Get composer cache directory
36+
run: |
37+
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
38+
39+
- name: Cache dependencies
40+
uses: actions/cache@v3
41+
with:
42+
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
43+
key: ${{ github.job }}-php-${{ inputs.php-version }}-${{ hashFiles('**/composer.*') }}
44+
restore-keys: |
45+
${{ github.job }}-php-${{ inputs.php-version }}-
46+
${{ github.job }}-
47+
48+
- name: Cache PHPUnit's static analysis cache
49+
uses: actions/cache@v3
50+
with:
51+
path: build/.phpunit.cache/code-coverage
52+
key: phpunit-code-coverage-${{ hashFiles('**/phpunit.*') }}
53+
restore-keys: |
54+
phpunit-code-coverage-
55+
56+
- name: Install dependencies
57+
run: composer update --ansi
58+
59+
- name: Merge coverage files
60+
run: vendor/bin/phpcov merge --clover build/logs/clover.xml build/cov
61+
62+
- name: Upload coverage to Coveralls
63+
run: vendor/bin/php-coveralls --verbose --exclude-no-stmt --ansi
64+
env:
65+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
name: Reusable PHPUnit Test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
job-name:
7+
description: Name of the job to appear in GitHub UI
8+
type: string
9+
required: true
10+
php-version:
11+
description: The PHP version the workflow should run
12+
type: string
13+
required: true
14+
job-id:
15+
description: Job ID to be used as part of cache key and artifact name
16+
type: string
17+
required: false
18+
db-platform:
19+
description: The database platform to be tested
20+
type: string
21+
required: false
22+
mysql-version:
23+
description: Version of the mysql Docker image
24+
type: string
25+
required: false
26+
group-name:
27+
description: The @group to test
28+
type: string
29+
required: false
30+
enable-artifact-upload:
31+
description: Whether artifact uploading of coverage results should be enabled
32+
type: boolean
33+
required: false
34+
enable-coverage:
35+
description: Whether coverage should be enabled
36+
type: boolean
37+
required: false
38+
enable-profiling:
39+
description: Whether slow tests should be profiled
40+
type: boolean
41+
required: false
42+
extra-extensions:
43+
description: Additional PHP extensions that are needed to be enabled
44+
type: string
45+
required: false
46+
extra-composer-options:
47+
description: Additional Composer options that should be appended to the `composer update` call
48+
type: string
49+
required: false
50+
extra-phpunit-options:
51+
description: Additional PHPUnit options that should be appended to the `vendor/bin/phpunit` call
52+
type: string
53+
required: false
54+
55+
env:
56+
NLS_LANG: 'AMERICAN_AMERICA.UTF8'
57+
NLS_DATE_FORMAT: 'YYYY-MM-DD HH24:MI:SS'
58+
NLS_TIMESTAMP_FORMAT: 'YYYY-MM-DD HH24:MI:SS'
59+
NLS_TIMESTAMP_TZ_FORMAT: 'YYYY-MM-DD HH24:MI:SS'
60+
61+
jobs:
62+
tests:
63+
name: ${{ inputs.job-name }}
64+
runs-on: ubuntu-22.04
65+
66+
# Service containers cannot be extracted to caller workflows yet
67+
services:
68+
mysql:
69+
image: mysql:${{ inputs.mysql-version || '8.0' }}
70+
env:
71+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
72+
MYSQL_DATABASE: test
73+
ports:
74+
- 3306:3306
75+
options: >-
76+
--health-cmd="mysqladmin ping"
77+
--health-interval=10s
78+
--health-timeout=5s
79+
--health-retries=3
80+
81+
postgres:
82+
image: postgres
83+
env:
84+
POSTGRES_USER: postgres
85+
POSTGRES_PASSWORD: postgres
86+
POSTGRES_DB: test
87+
ports:
88+
- 5432:5432
89+
options: >-
90+
--health-cmd=pg_isready
91+
--health-interval=10s
92+
--health-timeout=5s
93+
--health-retries=3
94+
95+
mssql:
96+
image: mcr.microsoft.com/mssql/server:2022-latest
97+
env:
98+
SA_PASSWORD: 1Secure*Password1
99+
ACCEPT_EULA: Y
100+
MSSQL_PID: Developer
101+
ports:
102+
- 1433:1433
103+
options: >-
104+
--health-cmd="/opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q 'SELECT @@VERSION'"
105+
--health-interval=10s
106+
--health-timeout=5s
107+
--health-retries=3
108+
109+
oracle:
110+
image: gvenzl/oracle-xe:21
111+
env:
112+
ORACLE_RANDOM_PASSWORD: true
113+
APP_USER: ORACLE
114+
APP_USER_PASSWORD: ORACLE
115+
ports:
116+
- 1521:1521
117+
options: >-
118+
--health-cmd healthcheck.sh
119+
--health-interval 20s
120+
--health-timeout 10s
121+
--health-retries 10
122+
123+
redis:
124+
image: redis
125+
ports:
126+
- 6379:6379
127+
options: >-
128+
--health-cmd "redis-cli ping"
129+
--health-interval=10s
130+
--health-timeout=5s
131+
--health-retries=3
132+
133+
memcached:
134+
image: memcached:1.6-alpine
135+
ports:
136+
- 11211:11211
137+
138+
steps:
139+
- name: Create database for MSSQL Server
140+
if: ${{ inputs.db-platform == 'SQLSRV' }}
141+
run: sqlcmd -S 127.0.0.1 -U sa -P 1Secure*Password1 -Q "CREATE DATABASE test"
142+
143+
- name: Install latest ImageMagick
144+
if: ${{ contains(inputs.extra-extensions, 'imagick') }}
145+
run: |
146+
sudo apt-get update
147+
sudo apt-get install --reinstall libgs9-common fonts-noto-mono libgs9:amd64 libijs-0.35:amd64 fonts-urw-base35 ghostscript poppler-data libjbig2dec0:amd64 gsfonts libopenjp2-7:amd64 fonts-droid-fallback fonts-dejavu-core
148+
sudo apt-get install -y imagemagick
149+
sudo apt-get install --fix-broken
150+
151+
- name: Checkout
152+
uses: actions/checkout@v3
153+
154+
- name: Setup PHP
155+
uses: shivammathur/setup-php@v2
156+
with:
157+
php-version: ${{ inputs.php-version }}
158+
tools: composer
159+
extensions: gd, ${{ inputs.extra-extensions }}
160+
coverage: ${{ env.COVERAGE_DRIVER }}
161+
env:
162+
COVERAGE_DRIVER: ${{ inputs.enable-coverage && 'xdebug' || 'none' }}
163+
164+
- name: Setup global environment variables
165+
run: |
166+
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
167+
echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}" >> $GITHUB_ENV
168+
169+
- name: Cache dependencies
170+
uses: actions/cache@v3
171+
with:
172+
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
173+
key: ${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}-${{ hashFiles('**/composer.*') }}
174+
restore-keys: |
175+
${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}-
176+
${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-
177+
${{ inputs.job-id || github.job }}-
178+
179+
- name: Cache PHPUnit's static analysis cache
180+
if: ${{ inputs.enable-artifact-upload }}
181+
uses: actions/cache@v3
182+
with:
183+
path: build/.phpunit.cache/code-coverage
184+
key: phpunit-code-coverage-${{ hashFiles('**/phpunit.*') }}
185+
restore-keys: |
186+
phpunit-code-coverage-
187+
188+
- name: Install dependencies
189+
run: |
190+
composer config --global github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
191+
composer update --ansi ${{ inputs.extra-composer-options }}
192+
193+
- name: Compute additional PHPUnit options
194+
run: |
195+
echo "EXTRA_PHPUNIT_OPTIONS=${{ format('{0} {1} {2}', env.GROUP_OPTION, env.COVERAGE_OPTION, inputs.extra-phpunit-options) }}" >> $GITHUB_ENV
196+
env:
197+
COVERAGE_OPTION: ${{ inputs.enable-coverage && format('--coverage-php build/cov/coverage-{0}.cov', env.ARTIFACT_NAME) || '--no-coverage' }}
198+
GROUP_OPTION: ${{ inputs.group-name && format('--group {0}', inputs.group-name) || '' }}
199+
200+
- name: Run tests
201+
run: script -e -c "vendor/bin/phpunit --color=always ${{ env.EXTRA_PHPUNIT_OPTIONS }}"
202+
env:
203+
DB: ${{ inputs.db-platform }}
204+
TACHYCARDIA_MONITOR_GA: ${{ inputs.enable-profiling && 'enabled' || '' }}
205+
TERM: xterm-256color
206+
207+
- name: Upload coverage results as artifact
208+
if: ${{ inputs.enable-artifact-upload }}
209+
uses: actions/upload-artifact@v3
210+
with:
211+
name: ${{ env.ARTIFACT_NAME }}
212+
path: build/cov/coverage-${{ env.ARTIFACT_NAME }}.cov
213+
if-no-files-found: error
214+
retention-days: 1

0 commit comments

Comments
 (0)