From e3477612e6795e004163e58d9e1daa37e991bfb1 Mon Sep 17 00:00:00 2001 From: deemonic Date: Sat, 19 Oct 2024 22:58:23 +0100 Subject: [PATCH] updated workflow --- .github/workflows/main.yml | 55 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b855393..016e90c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,45 +1,44 @@ -name: run-tests +name: Tests -on: - push: - branches: [main] - pull_request: - branches: [main] +on: ["push", "pull_request"] jobs: - test: + ci: runs-on: ${{ matrix.os }} strategy: fail-fast: true matrix: - os: [ubuntu-latest, windows-latest] - php: [7.4, 8.0] - laravel: [8.*, 9.*, 10.*, 11.*] - stability: [prefer-lowest, prefer-stable] - include: - - laravel: 11.* - testbench: ^6.6 + os: [ubuntu-latest] + php: ["8.3"] + dependency-version: [prefer-lowest, prefer-stable] - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v4 - 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, fileinfo + extensions: dom, mbstring, zip 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 + - name: Get Composer cache directory + id: composer-cache + shell: bash + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }} + restore-keys: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer- + + - name: Install Composer dependencies + run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist + + - name: Run Tests + run: php ./vendor/bin/phpunit