Skip to content

Commit a16edc5

Browse files
authored
Composer 2 (#26)
* Composer 2 now can be used without any limitations * hirak/prestissimo installation removed on CI * Try to fix unit tests * Changelog updated
1 parent 63e832e commit a16edc5

File tree

5 files changed

+16
-21
lines changed

5 files changed

+16
-21
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs: # Docs: <https://help.github.com/en/articles/workflow-syntax-for-github-ac
4040
with:
4141
php-version: ${{ matrix.php }}
4242
extensions: mbstring, pdo, pdo_sqlite, sqlite3 # definition is required for php 7.4
43-
tools: composer:v1 # TODO update composer up to v2
4443

4544
- name: Get Composer Cache Directory # Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
4645
id: composer-cache
@@ -53,16 +52,13 @@ jobs: # Docs: <https://help.github.com/en/articles/workflow-syntax-for-github-ac
5352
key: ${{ runner.os }}-composer-${{ matrix.setup }}-${{ hashFiles('**/composer.json') }}
5453
restore-keys: ${{ runner.os }}-composer-
5554

56-
- name: Install Composer 'hirak/prestissimo' package
57-
run: composer global require hirak/prestissimo --update-no-dev --no-progress --ansi
58-
5955
- name: Install lowest Composer dependencies
6056
if: matrix.setup == 'lowest'
61-
run: composer update --prefer-dist --no-interaction --no-suggest --prefer-lowest --ansi
57+
run: composer update --prefer-dist --no-interaction --prefer-lowest --ansi
6258

6359
- name: Install basic Composer dependencies
6460
if: matrix.setup == 'basic'
65-
run: composer update --prefer-dist --no-interaction --no-suggest --ansi
61+
run: composer update --prefer-dist --no-interaction --ansi
6662

6763
- name: Show most important packages versions
6864
run: composer info | grep -e laravel -e spiral -e phpunit/phpunit -e phpstan/phpstan
@@ -94,7 +90,6 @@ jobs: # Docs: <https://help.github.com/en/articles/workflow-syntax-for-github-ac
9490
with:
9591
php-version: 7.4
9692
extensions: mbstring
97-
tools: composer:v1 # TODO update composer up to v2
9893

9994
- name: Get Composer Cache Directory
10095
id: composer-cache
@@ -107,11 +102,8 @@ jobs: # Docs: <https://help.github.com/en/articles/workflow-syntax-for-github-ac
107102
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
108103
restore-keys: ${{ runner.os }}-composer-
109104

110-
- name: Install Composer 'hirak/prestissimo' package
111-
run: composer global require hirak/prestissimo --update-no-dev --ansi
112-
113105
- name: Install Composer dependencies
114-
run: composer update --prefer-dist --no-interaction --no-suggest --ansi
106+
run: composer update --prefer-dist --no-interaction --ansi
115107

116108
- name: Execute check
117109
run: composer cs-check

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].
66

7+
## UNRELEASED
8+
9+
### Changed
10+
11+
- Composer `2.x` is supported now
12+
713
## v3.6.0
814

915
### Changed

Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
FROM php:7.3.5-alpine
22

3-
ENV \
4-
COMPOSER_ALLOW_SUPERUSER="1" \
5-
COMPOSER_HOME="/tmp/composer"
3+
ENV COMPOSER_HOME="/tmp/composer"
64

7-
COPY --from=composer:1.10.10 /usr/bin/composer /usr/bin/composer
5+
COPY --from=composer:2.0.7 /usr/bin/composer /usr/bin/composer
86

97
RUN set -x \
108
&& apk add --no-cache binutils git \
119
&& apk add --no-cache --virtual .build-deps autoconf pkgconf make g++ gcc 1>/dev/null \
1210
# install xdebug (for testing with code coverage), but do not enable it
1311
&& pecl install xdebug-2.9.6 1>/dev/null \
1412
&& apk del .build-deps \
15-
&& mkdir /src ${COMPOSER_HOME} \
16-
&& composer global require 'hirak/prestissimo' --no-interaction --no-suggest --prefer-dist \
13+
&& mkdir -p /src ${COMPOSER_HOME}/cache/{repo,files} \
1714
&& ln -s /usr/bin/composer /usr/bin/c \
1815
&& chmod -R 777 ${COMPOSER_HOME} \
1916
&& composer --version \

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ build: ## Build docker images, required for current package environment
1717
docker-compose build
1818

1919
latest: clean ## Install latest php dependencies
20-
docker-compose run $(RUN_APP_ARGS) app composer update -n --ansi --no-suggest --prefer-dist --prefer-stable
20+
docker-compose run $(RUN_APP_ARGS) app composer update -n --ansi --prefer-dist --prefer-stable
2121

2222
install: clean ## Install regular php dependencies
23-
docker-compose run $(RUN_APP_ARGS) app composer update -n --prefer-dist --no-interaction --no-suggest
23+
docker-compose run $(RUN_APP_ARGS) app composer update -n --prefer-dist --no-interaction
2424

2525
lowest: clean ## Install lowest php dependencies
26-
docker-compose run $(RUN_APP_ARGS) app composer update -n --ansi --no-suggest --prefer-dist --prefer-lowest
26+
docker-compose run $(RUN_APP_ARGS) app composer update -n --ansi --prefer-dist --prefer-lowest
2727

2828
test: ## Execute php tests and linters
2929
docker-compose run $(RUN_APP_ARGS) app composer test

tests/WorkerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ private function getAfterBootstrapClosure(): callable
475475
*/
476476
private function getOnceRequestGenerationClosure(
477477
string $method = 'GET',
478-
string $uri = '/',
478+
string $uri = 'http://unit-test/',
479479
array $server_params = []
480480
): callable {
481481
return function () use ($method, $uri, $server_params): ?ServerRequestInterface {

0 commit comments

Comments
 (0)