From 1f6c221c9d14667bf9ce22576cb0ed1aa841f0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 31 Oct 2023 10:36:54 +0100 Subject: [PATCH] Enable tests on github actions --- .github/workflows/tests.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..28fb8f1 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,36 @@ +name: Tests +on: [push, pull_request] +jobs: + units-tests: + name: Run tests + runs-on: ubuntu-latest + strategy: + matrix: + php: [ '8.1', '8.2'] + tests: ['unit_tests', 'integration_tests', 'endtoend_tests'] + fail-fast: false + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + - uses: actions/checkout@v2 + + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache Composer Directory + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Composer Install + run: composer install --ansi --prefer-dist --no-interaction --no-progress + + - name: Run ${{ matrix.tests }} + run: ./vendor/bin/phpunit --testsuite ${{ matrix.tests }}