From ae2da9930434935faf4b932db6e2ae8837ae51eb Mon Sep 17 00:00:00 2001 From: Antonio De Marco Date: Thu, 3 Oct 2024 11:25:52 +0200 Subject: [PATCH] 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