Skip to content

Commit 8255982

Browse files
committed
Update tests
1 parent 7004b0e commit 8255982

4 files changed

Lines changed: 120 additions & 7 deletions

File tree

‎.github/php-minimum/Dockerfile‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM php:8.2.0-cli@sha256:fa840989efc52df732278f59377e780f65d6aa8c384bb9724babf190b49f4c35
2+
3+
ENV COMPOSER_ALLOW_SUPERUSER=1 \
4+
COMPOSER_HOME=/tmp/composer-home \
5+
COMPOSER_CACHE_DIR=/tmp/composer-cache
6+
7+
COPY scripts/setup-minimum-php.sh /usr/local/bin/setup-minimum-php
8+
RUN bash /usr/local/bin/setup-minimum-php
9+
10+
# Match the extensions and curl release used to qualify the exact minimum.
11+
# Versioned symbols retain the Debian ABI required by the official PHP binary.
12+
RUN apt-get install -y --no-install-recommends libssl-dev libxslt1-dev \
13+
&& docker-php-ext-install -j2 calendar exif pcntl soap xsl
14+
15+
RUN curl --fail --silent --show-error --location --retry 3 --retry-all-errors \
16+
--retry-delay 2 --connect-timeout 15 --max-time 120 \
17+
https://curl.se/download/curl-8.10.1.tar.xz --output /tmp/curl.tar.xz \
18+
&& echo '73a4b0e99596a09fa5924a4fb7e4b995a85fda0d18a2c02ab9cf134bebce04ee /tmp/curl.tar.xz' | sha256sum --check \
19+
&& tar -xf /tmp/curl.tar.xz -C /tmp \
20+
&& cd /tmp/curl-8.10.1 \
21+
&& ./configure --prefix=/opt/curl --with-openssl --enable-versioned-symbols --disable-static --without-libpsl \
22+
&& make -j2 \
23+
&& make install \
24+
&& echo /opt/curl/lib > /etc/ld.so.conf.d/minimum-curl.conf \
25+
&& ldconfig \
26+
&& PKG_CONFIG_PATH=/opt/curl/lib/pkgconfig docker-php-ext-install curl \
27+
&& rm -rf /tmp/curl* /var/lib/apt/lists/*
28+
29+
WORKDIR /var/www/html
30+
RUN php -r 'echo PHP_VERSION, PHP_EOL; exit(PHP_VERSION === "8.2.0" ? 0 : 1);'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copied into .ddev only for the exact-minimum jobs.
2+
services:
3+
php-minimum:
4+
container_name: ddev-${DDEV_SITENAME}-php-minimum
5+
platform: linux/amd64
6+
build:
7+
context: ../.github
8+
dockerfile: php-minimum/Dockerfile
9+
user: "${DDEV_UID}:${DDEV_GID}"
10+
working_dir: /var/www/html
11+
command: [sleep, infinity]
12+
restart: "no"
13+
environment:
14+
IS_DDEV_PROJECT: "true"
15+
DDEV_SITENAME: ${DDEV_SITENAME}
16+
labels:
17+
com.ddev.site-name: ${DDEV_SITENAME}
18+
com.ddev.approot: ${DDEV_APPROOT}
19+
volumes:
20+
- ../:/var/www/html:cached
21+
healthcheck:
22+
test: [CMD, php, -r, 'exit(PHP_VERSION === "8.2.0" ? 0 : 1);']
23+
interval: 5s
24+
timeout: 5s
25+
retries: 12

‎.github/workflows/tests.yml‎

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ on:
77
permissions:
88
contents: read
99
jobs:
10+
dependency-audit:
11+
name: Production dependency audit
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 10
14+
steps:
15+
- uses: actions/checkout@v5
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: npm
20+
- run: npm ci
21+
- run: npm audit --omit=dev
1022
php-check:
1123
name: PHP 8.2.0 syntax and imports
1224
runs-on: ubuntu-22.04
@@ -61,13 +73,14 @@ jobs:
6173
.cache/php-check/composer.json
6274
.cache/php-check/composer.lock
6375
pest:
64-
name: PHP ${{ matrix.php }}
76+
name: PHP ${{ matrix.php }} (${{ matrix.order }})
6577
runs-on: ubuntu-latest
6678
timeout-minutes: 30
6779
strategy:
6880
fail-fast: false
6981
matrix:
7082
php: ["8.2", "8.3", "8.4"]
83+
order: [default, random]
7184
steps:
7285
- uses: actions/checkout@v5
7386
- uses: actions/setup-node@v4
@@ -77,23 +90,68 @@ jobs:
7790
- name: Validate Composer manifest
7891
run: composer validate --no-plugins --no-check-publish
7992
- name: Build production assets
80-
run: npm ci && npm audit --omit=dev && npm run test:frontend && npm run build
93+
run: npm ci && npm run test:frontend && npm run build
8194
- uses: ddev/github-action-setup-ddev@v1
8295
with:
8396
version: "1.25.4"
8497
autostart: false
8598
- name: Configure PHP runtime
8699
run: bash .github/scripts/configure-ddev.sh "${{ matrix.php }}"
87100
- name: Clean-install integration and performance tests
88-
run: ddev test --suite=all
101+
run: ddev test --suite=all --order-by=${{ matrix.order }} --random-order-seed=9122026
102+
- name: Test diagnostics
103+
if: always()
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: test-diagnostics-php-${{ matrix.php }}-${{ matrix.order }}
107+
include-hidden-files: true
108+
path: |
109+
.cache/verbb-tests/latest.log
110+
.cache/verbb-tests/junit.xml
111+
.cache/verbb-tests/result.json
112+
.cache/verbb-tests/app/storage/logs/
113+
pest-minimum:
114+
name: PHP 8.2.0 (${{ matrix.order }})
115+
runs-on: ubuntu-latest
116+
timeout-minutes: 45
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
order: [default, random]
121+
steps:
122+
- uses: actions/checkout@v5
123+
- uses: actions/setup-node@v4
124+
with:
125+
node-version: 22
126+
cache: npm
127+
- name: Build production assets
128+
run: npm ci && npm run build
129+
- uses: ddev/github-action-setup-ddev@v1
130+
with:
131+
version: '1.25.4'
132+
autostart: false
133+
- name: Configure exact minimum service
134+
run: cp .github/php-minimum/docker-compose.yaml .ddev/docker-compose.php-minimum.yaml
135+
- name: Start isolated DDEV runtime
136+
run: bash .github/scripts/configure-ddev.sh 8.3
137+
- name: Verify exact minimum interpreter and integration lock
138+
run: |
139+
ddev exec --service php-minimum --raw -- php -r 'echo PHP_VERSION, PHP_EOL; exit(PHP_VERSION === "8.2.0" ? 0 : 1);'
140+
ddev exec --service php-minimum --raw -- php .github/scripts/check-runtime-lock.php
141+
- name: Clean-install integration and performance tests
142+
run: ddev exec --service php-minimum --raw -- php tests/runtime/run.php --suite=all --order-by=${{ matrix.order }} --random-order-seed=9122026
143+
- name: Verify installed dependency platform requirements
144+
run: ddev exec --service php-minimum --raw -- composer check-platform-reqs --working-dir=.cache/verbb-tests/app --no-plugins
89145
- name: Test diagnostics
90146
if: always()
91147
uses: actions/upload-artifact@v4
92148
with:
93-
name: test-diagnostics-php-${{ matrix.php }}
149+
name: php-8.2.0-${{ matrix.order }}
94150
include-hidden-files: true
95151
path: |
96152
.cache/verbb-tests/latest.log
97153
.cache/verbb-tests/junit.xml
98154
.cache/verbb-tests/result.json
155+
.cache/verbb-tests/app/composer.json
156+
.cache/verbb-tests/app/composer.lock
99157
.cache/verbb-tests/app/storage/logs/

‎package-lock.json‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)