diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 547e71e..7c9303f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,6 +9,10 @@ env: jobs: tests: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + symfonyVersion: ["5.4.*", "6.1.*"] steps: - name: 'Check out the repo' @@ -19,7 +23,7 @@ jobs: run: 'docker login --username "$DOCKERHUB_USER" --password "$DOCKERHUB_TOKEN"' - name: 'Build image' - run: 'docker build -t $APP_IMAGE .' + run: 'docker build --build-arg SYMFONY_REQUIRE=${{ matrix.symfonyVersion }} -t $APP_IMAGE .' - name: 'Run tests' run: 'docker run ${{env.APP_IMAGE}} composer ci' diff --git a/Dockerfile b/Dockerfile index 4fcb3ae..e1a208e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,8 @@ ARG phpversion=8 FROM php:${phpversion}-cli ARG COMPOSER_FLAGS="--prefer-dist --no-interaction" +ARG SYMFONY_REQUIRE=6.* + ARG DEBIAN_FRONTEND=noninteractive ENV COMPOSER_ALLOW_SUPERUSER 1 ENV COMPOSER_PROCESS_TIMEOUT 3600 @@ -19,6 +21,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && chmod +x /tmp/composer-install.sh \ && /tmp/composer-install.sh +# To enable SYMFONY_REQUIRE +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer \ + && composer global config allow-plugins.symfony/flex true \ + && composer global require --no-progress --no-scripts --no-plugins symfony/flex + ## Composer - deps always cached unless changed # First copy only composer files COPY composer.* /code/ diff --git a/composer.json b/composer.json index 7840877..925c9b4 100644 --- a/composer.json +++ b/composer.json @@ -6,10 +6,10 @@ "PHP": "^7.4|^8.0", "ext-json": "*", "keboola/php-temp": "^2.0", - "phpunit/phpunit": "^9.0", - "symfony/filesystem": "^5.0", - "symfony/finder": "^5.0", - "symfony/process": "^5.0" + "phpunit/phpunit": "^9.5", + "symfony/filesystem": "^5.0|^6.0", + "symfony/finder": "^5.0|^6.0", + "symfony/process": "^5.0|^6.0" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.3", @@ -35,6 +35,7 @@ }, "config": { "sort-packages": true, + "lock": false, "optimize-autoloader": true, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true