From 016a149d2d5cd5b124723e886aa5f43f1c5339e8 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Wed, 27 Mar 2024 15:44:27 +0100 Subject: [PATCH] Update github workflows --- .github/workflows/npm-build.yml | 2 +- .github/workflows/phpstan.yml | 58 +++++++++++++++--------------- .github/workflows/tests.yml | 63 ++++++++++++++++++--------------- 3 files changed, 66 insertions(+), 57 deletions(-) diff --git a/.github/workflows/npm-build.yml b/.github/workflows/npm-build.yml index 3b7040501..52feee2c6 100755 --- a/.github/workflows/npm-build.yml +++ b/.github/workflows/npm-build.yml @@ -25,7 +25,7 @@ jobs: run: yarn install --frozen-lockfile - name: Build assets - run: yarn build + run: yarn run build - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index f9f93fc56..49b3a16b9 100755 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -10,31 +10,33 @@ jobs: strategy: fail-fast: false matrix: - php: [8.2, 8.1] - laravel: [10.*, 9.*] - dependency-version: [prefer-stable] - include: - - laravel: 10.* - testbench: 8.* - - laravel: 9.* - testbench: 7.* - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - steps: - - uses: actions/checkout@v3 - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ~/.composer/cache/files - key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mbstring, pdo, pdo_sqlite - coverage: none - - 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: Run PHPStan - run: ./vendor/bin/phpstan analyse + php: [8.2] + laravel: [10.*, 11.*] + dependencies: ["highest"] + + name: "PHP ${{ matrix.php }} - L${{ matrix.laravel }} ${{ matrix.dependencies == 'highest' && '↑' || '↓' }}" + + runs-on: "ubuntu-latest" + + steps: + - name: "Checkout code" + uses: "actions/checkout@v3" + + - name: "Setup PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php }}" + extensions: "dom, curl, libxml, mbstring, zip, fileinfo" + tools: "composer:v2" + coverage: "none" + + - name: "Install dependencies from composer.json" + if: "matrix.dependencies != 'lowest'" + run: "composer update --with='laravel/framework:${{ matrix.laravel }}' --no-interaction --no-progress" + + - name: "Install lowest dependencies from composer.json" + if: "matrix.dependencies == 'lowest'" + run: "composer update --with='laravel/framework:${{ matrix.laravel }}' --no-interaction --no-progress --prefer-lowest" + + - name: "Run PHPStan" + run: ./vendor/bin/phpstan diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a768a7277..a14bee7b2 100755 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,31 +10,38 @@ jobs: strategy: fail-fast: false matrix: - php: [8.2, 8.1] - laravel: [10.*, 9.*] - dependency-version: [prefer-stable] - include: - - laravel: 10.* - testbench: 8.* - - laravel: 9.* - testbench: 7.* - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - steps: - - uses: actions/checkout@v3 - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ~/.composer/cache/files - key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: intl, mbstring, pdo, pdo_sqlite - coverage: none - - 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/pest --verbose + php: [8.2] + laravel: [10.*] + phpunit-versions: ['latest'] + name: PHP:${{ matrix.php }} / Laravel:${{ matrix.laravel }} + steps: + - uses: actions/checkout@v2 + - name: Setup PHP, with composer and extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: mbstring, intl, amqp, dba + tools: composer:v2, phpunit:${{ matrix.php }} + + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache composer dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + restore-keys: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer- + + - name: Install Composer dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update --dev + composer update --prefer-stable --no-interaction --no-suggest + + - name: Execute tests (Unit and Feature tests) + env: + APP_ENV: testing + DB_CONNECTION: testing + DB_DATABASE: ":memory:" + run: ./vendor/bin/pest --verbose