From ae2da9930434935faf4b932db6e2ae8837ae51eb Mon Sep 17 00:00:00 2001 From: Antonio De Marco Date: Thu, 3 Oct 2024 11:25:52 +0200 Subject: [PATCH 1/4] Use docker compose in GitHub action. --- .github/workflows/ci.yml | 18 ++++++++---------- .gitignore | 1 + docker-compose.yml | 5 +++++ 3 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 docker-compose.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9c85b4..b120ec9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,10 @@ name: CI -on: [push, pull_request_target] +on: [push, pull_request] jobs: build-test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: matrix: ROBO_VERSION: [ "4.0", "5.0" ] @@ -14,14 +14,12 @@ jobs: PHP_VERSION: "8.0" - ROBO_VERSION: "4.0" PHP_VERSION: "8.1" - steps: - uses: actions/checkout@v2 - - uses: php-actions/composer@v6 - with: - command: "require consolidation/robo:~${{ matrix.ROBO_VERSION }}" - php_version: ${{ matrix.PHP_VERSION }} - version: 2 - - uses: php-actions/phpunit@v3 + - name: test with: - test_suffix: FALSE + PHP_VERSION: ${{ matrix.PHP_VERSION }} + run: | + docker compose up -d + docker compose exec -T php require consolidation/robo:~${{ matrix.ROBO_VERSION }} + docker compose exec -T php phpunit diff --git a/.gitignore b/.gitignore index 6fb383b..00bbe25 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ composer.lock grumphp.yml phpunit.xml tests/fixtures/tmp/*.php +.phpunit.result.cache \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b4d71a8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,5 @@ +services: + php: + image: wodby/php:${PHP_VERSION} + volumes: + - .:/var/www/html From ff3ce644b7149bd4e5256905366ccad448b316e5 Mon Sep 17 00:00:00 2001 From: Antonio De Marco Date: Thu, 3 Oct 2024 11:31:38 +0200 Subject: [PATCH 2/4] Fix CI workflow. --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b120ec9..bb4594f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,11 +14,12 @@ jobs: PHP_VERSION: "8.0" - ROBO_VERSION: "4.0" PHP_VERSION: "8.1" + env: + PHP_VERSION: ${{ matrix.PHP_VERSION }} steps: - - uses: actions/checkout@v2 + - name: clone + uses: actions/checkout@v4 - name: test - with: - PHP_VERSION: ${{ matrix.PHP_VERSION }} run: | docker compose up -d docker compose exec -T php require consolidation/robo:~${{ matrix.ROBO_VERSION }} From 7deb68523fea5d33760d071ccfaa4f566b6b7ba2 Mon Sep 17 00:00:00 2001 From: Antonio De Marco Date: Thu, 3 Oct 2024 11:32:54 +0200 Subject: [PATCH 3/4] Fix composer require. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb4594f..dbe6aed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,5 +22,5 @@ jobs: - name: test run: | docker compose up -d - docker compose exec -T php require consolidation/robo:~${{ matrix.ROBO_VERSION }} + docker compose exec -T php composer require consolidation/robo:~${{ matrix.ROBO_VERSION }} docker compose exec -T php phpunit From de5f093356206ae1971f05261601ac6dda3640d7 Mon Sep 17 00:00:00 2001 From: Antonio De Marco Date: Thu, 3 Oct 2024 11:34:35 +0200 Subject: [PATCH 4/4] Run tests with root. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbe6aed..5c7479f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,5 +22,5 @@ jobs: - name: test run: | docker compose up -d - docker compose exec -T php composer require consolidation/robo:~${{ matrix.ROBO_VERSION }} - docker compose exec -T php phpunit + docker compose exec -u root -T php composer require consolidation/robo:~${{ matrix.ROBO_VERSION }} + docker compose exec -u root -T php phpunit