Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d200dbb
Update PHP8 appreciate for new workshop version
AydinHassan May 11, 2024
f435075
Update branch
AydinHassan May 17, 2024
2da5ce2
Run with docker process factory
AydinHassan May 17, 2024
dac57b9
Prime docker image
AydinHassan May 22, 2024
397bcbe
Try fix
AydinHassan May 25, 2024
1dc4d4a
Remove unneccessary cleanup
AydinHassan May 25, 2024
8bcd69b
Run tests with both host + docker
AydinHassan May 25, 2024
8f97aa2
Update deps
AydinHassan Sep 6, 2024
ff1a833
Upgrade to PHP 8.2+, PHPUnit 11, PHPStan 2, PHPCS 3.13
AydinHassan Oct 22, 2026
8ef53d6
Fix code for nikic/php-parser 5 and PHPStan 2
AydinHassan Oct 22, 2026
e7a298d
Migrate tests to PHPUnit 11 (restore global error handler left by App…
AydinHassan Oct 22, 2026
688c157
Fix PHP 8.4+ deprecations in solutions: fgetcsv/fputcsv escape, symfo…
AydinHassan Oct 22, 2026
2eecb01
CI: test PHP 8.2-8.5, add timeout, phpunit --stop-on-error, drop cove…
AydinHassan Oct 22, 2026
2adb95d
Pin lord-of-the-strings solution deps to PHP 8.2 platform so they run…
AydinHassan Oct 22, 2026
619fed8
Update composer.lock against php-workshop docker-fixes
AydinHassan Oct 22, 2026
483d4f7
Require php-workshop dev-master and lock for PHP 8.2
AydinHassan Oct 22, 2026
5abaae3
Drop the error handler tearDown, php-workshop restores it now
AydinHassan Oct 22, 2026
f5136d5
Lock php-workshop at current master
AydinHassan Oct 22, 2026
9a7b12c
Name the test suite after the workshop
AydinHassan Oct 22, 2026
d56d77e
CI: match learn-you-php's build workflow
AydinHassan Oct 22, 2026
b8ded30
have-the-last-say: explain the escape argument without mentioning dep…
AydinHassan Oct 22, 2026
c5605ed
Merge pull request #50 from php-school/rewrite-deps
AydinHassan Oct 22, 2026
ce87892
Rename PROCESS_FACTORY to SANDBOX and update php-workshop
AydinHassan Oct 27, 2026
d741a52
Create /solution and /composer in the runtime image, for the composer…
AydinHassan Oct 27, 2026
b37cc84
Warm the reference packages cache on composer install and update
AydinHassan Oct 27, 2026
07a33aa
Update php-workshop for ReferencePackages
AydinHassan Oct 27, 2026
98428c3
Create /solution/vendor in the runtime image, for the vendor volume
AydinHassan Oct 27, 2026
3a99415
chore: drop the unused sandbox mkdirs from the runtime image (#51)
AydinHassan Nov 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .docker/runtime/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM php:8.3-alpine AS build

RUN apk add --no-cache $PHPIZE_DEPS && \
apk add --no-cache linux-headers

RUN docker-php-ext-install sockets

FROM php:8.3-alpine AS final

COPY --from=build /usr/local/lib/php /usr/local/lib/php
COPY --from=build /usr/local/etc/php /usr/local/etc/php

RUN apk add git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
#the solution is copied in here. Writable by whichever user the sandbox runs as, eg. for files the code writes
RUN mkdir -m 1777 /solution
14 changes: 14 additions & 0 deletions .docker/runtime/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
runtime:
image: php8appreciate-runtime
build:
context: .
dockerfile: Dockerfile

user: ${UID}:${GID}

volumes:
- type: bind
source: ${SOLUTION}
target: '/solution'

31 changes: 16 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,41 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
php: [8.0, 8.1, 8.2, 8.3]
php: ['8.2', '8.3', '8.4', '8.5']

name: PHP ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2,pecl
extensions: pdo_sqlite
ini-values: opcache.enable=0
tools: composer:v2
extensions: pdo_sqlite, sockets
coverage: none

- name: Install Dependencies
run: composer update
run: composer update --prefer-dist --no-progress

- name: Build runtime image
run: docker build -t phpunit-runtime .docker/runtime

- name: Run phpunit tests (docker)
run: SANDBOX=docker vendor/bin/phpunit --stop-on-error

- name: Run phpunit tests (host)
run: SANDBOX=host vendor/bin/phpunit --stop-on-error

- name: Run phpunit tests
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml
- name: Run phpcs
run: composer cs

Expand All @@ -55,7 +60,3 @@ jobs:
chmod +x workshop-manager.phar
./workshop-manager.phar install php8appreciate master
./workshop-manager.phar installed

- name: Coverage upload
if: matrix.php == '8.0'
run: bash <(curl -s https://codecov.io/bash)
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/exercises/*/solution/vendor
/test/solutions/*/*/vendor
.phpunit.result.cache
.phpunit.cache
18 changes: 12 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
}
],
"require": {
"php": "^8.0",
"php": ">=8.2",
"php-school/php-workshop": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "^9",
"squizlabs/php_codesniffer": "^3.5",
"phpstan/phpstan": "^1.8.10",
"timeweb/phpstan-enum": "^3.1"
"phpunit/phpunit": "^11.5",
"squizlabs/php_codesniffer": "^3.13",
"phpstan/phpstan": "^2.1"
},
"autoload": {
"psr-4": {
Expand All @@ -41,6 +40,8 @@
}
},
"scripts": {
"post-install-cmd": "@php bin/php8appreciate warm-cache",
"post-update-cmd": "@php bin/php8appreciate warm-cache",
"test": [
"@unit-tests",
"@cs",
Expand All @@ -59,5 +60,10 @@
},
"bin": [
"bin/php8appreciate"
]
],
"config": {
"platform": {
"php": "8.2.0"
}
}
}
Loading
Loading