From 3dfebb73c9b2aebbec29561ad00704358aa5909e Mon Sep 17 00:00:00 2001 From: Nick Escobedo Date: Sun, 21 Jul 2024 11:32:29 -0500 Subject: [PATCH] Test runner (#1) Add test runner --- .github/workflows/tests.yml | 52 +++++++++++++++++++++++++++++++++++++ composer.json | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) 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..02f9af4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,52 @@ +name: run-tests + +on: + push: + paths: + - '**.php' + - '.github/workflows/tests.yml' + - 'phpunit.xml' + - 'composer.json' + - 'composer.lock' + +jobs: + test: + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest] + php: [8.3, 8.2] + laravel: [11.*] + stability: [prefer-stable] + include: + - laravel: 11.* + testbench: 9.* + carbon: ^2.63 + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: libxml, mbstring, zip, pcntl, bcmath, soap, intl, gd, exif, iconv + coverage: none + + - name: Setup problem matchers + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.stability }} --prefer-dist --no-interaction + + - name: Execute tests + run: vendor/bin/phpunit \ No newline at end of file diff --git a/composer.json b/composer.json index 27c7403..ac5d5b1 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } ], "require": { - "php": "^8.1" + "php": "^8.2|^8.3" }, "minimum-stability": "dev", "prefer-stable": true,