From 0986d7d9d6a948422cbefe78626cac2c21fbe3be Mon Sep 17 00:00:00 2001 From: farhad zandmoghadam Date: Sun, 12 May 2024 13:54:15 +0330 Subject: [PATCH] Update run-tests.yml --- .github/workflows/run-tests.yml | 66 ++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 533510c..ad034c8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,44 +1,52 @@ -name: run-tests +name: Tests -on: [push, pull_request] +on: + push: + pull_request: jobs: - test: - runs-on: ${{ matrix.os }} + run: + runs-on: 'ubuntu-latest' strategy: - fail-fast: true + fail-fast: false matrix: - php: ['8.2','8.3'] + php: ['8.1', '8.2','8.3'] os: [ubuntu-latest] stability: [prefer-stable] - laravel: [10.*, 11.*] + laravel: [9.*, 10.*, 11.*] include: + - laravel: 9.* + testbench: 7.* - laravel: 10.* testbench: 7.* - laravel: 11.* testbench: 7.* - - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick - 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.dependency-version }} --prefer-dist --no-interaction - - name: Execute tests - run: vendor/bin/phpunit + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: bcmath, curl, dom, mbstring, pcntl, sockets, xml, intl + coverage: none + + - name: Set up Docker + run: | + sudo rm /usr/local/bin/docker-compose + curl -SL https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-`uname -s`-`uname -m` > docker-compose + chmod +x docker-compose + sudo mv docker-compose /usr/local/bin + - name: Start Docker container + run: docker-compose up -d + + - name: Install dependencies + run: | + composer update --${{ matrix.stability }} --prefer-dist --no-interaction + + - name: Execute tests + run: vendor/bin/phpunit