From 6cee4faac7fa524c27dc68b5a578e528d0a00ae5 Mon Sep 17 00:00:00 2001 From: Shift Date: Tue, 27 Feb 2024 14:41:26 +0000 Subject: [PATCH] Update GitHub Actions for Laravel 11 --- .github/workflows/run-tests.yml | 61 ++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 31cd93e..ef3698b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -2,70 +2,102 @@ name: Run tests on: push: - branches: [main] + branches: + - main paths-ignore: - - "docs/**" - - "README.md" + - docs/** + - README.md pull_request: - branches: [main] + branches: + - main jobs: vite: - if: ${{ !startsWith(github.event.head_commit.message, 'release:') }} + if: "${{ !startsWith(github.event.head_commit.message, 'release:') }}" + + runs-on: ${{ matrix.os }} + + strategy: matrix: - node-version: [16.x] - os: [ubuntu-latest, windows-latest] + node-version: + - 16.x + os: + - ubuntu-latest + - windows-latest + + name: Vite - Node ${{ matrix.os }} - ${{ matrix.os }} + + steps: - uses: actions/checkout@v2 + - name: Install pnpm uses: pnpm/action-setup@v2.0.1 with: version: 6.24.4 + - name: Use Node ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} registry-url: https://registry.npmjs.org/ - cache: "pnpm" + cache: pnpm - run: pnpm install + - name: Build run: pnpm run build + - name: Test run: pnpm run test:vite php: - if: ${{ !startsWith(github.event.head_commit.message, 'release:') }} + if: "${{ !startsWith(github.event.head_commit.message, 'release:') }}" + + runs-on: ${{ matrix.os }} + + strategy: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.1, 8.0] - laravel: ["8.*", "9.*", 10.*] + php: [8.0, 8.1, '8.2'] + laravel: ['8.*', '9.*', '10.*', '11.*'] stability: [prefer-stable] include: - laravel: 10.* testbench: 8.* - - laravel: "8.*" + - laravel: 8.* testbench: 6.* - - laravel: "9.*" + - laravel: 9.* testbench: 7.x-dev + - laravel: 11.* + testbench: 9.* exclude: - laravel: 10.* php: 8.0 + - laravel: 11.* + php: 8.0 + - laravel: 11.* + php: 8.1 + + name: PHP ${{ 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: @@ -73,15 +105,18 @@ jobs: extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo 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/pest