Skip to content

Commit

Permalink
Update GitHub Actions for Laravel 12
Browse files Browse the repository at this point in the history
  • Loading branch information
laravel-shift committed Feb 16, 2025
1 parent 1dc00eb commit fd89229
Showing 1 changed file with 51 additions and 44 deletions.
95 changes: 51 additions & 44 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,55 @@
name: run-tests

on: [pull_request]
on:
- pull_request

jobs:
test:
if: "!contains(github.event.commits[0].message, '[skip ci]')"
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.3]
laravel: [11.*]
include:
- laravel: 11.*
testbench: 9.*
name: PHP ${{ matrix.php }} - LARAVEL ${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Decrypt services-account.json
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$GOOGLE_SERVICES_SECRET" \
--output $GITHUB_WORKSPACE/tests/fixtures/service-account.json $GITHUB_WORKSPACE/tests/fixtures/service-account.json.gpg
env:
GOOGLE_SERVICES_SECRET: ${{ secrets.GOOGLE_SERVICES_SECRET }}

- name: Cache dependencies
uses: actions/cache@v1
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: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/filesystem:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-suggest
- name: Run Tests
run: vendor/bin/phpunit
test:
if: "!contains(github.event.commits[0].message, '[skip ci]')"

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: ['8.2', 8.3, '8.3', '8.4']
laravel: ['11.*', '12.*']
include:
- laravel: 11.*
testbench: 9.*
- laravel: 12.*
testbench: 10.*

name: PHP ${{ matrix.php }} - LARAVEL ${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Decrypt services-account.json
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$GOOGLE_SERVICES_SECRET" \
--output $GITHUB_WORKSPACE/tests/fixtures/service-account.json $GITHUB_WORKSPACE/tests/fixtures/service-account.json.gpg
env:
GOOGLE_SERVICES_SECRET: ${{ secrets.GOOGLE_SERVICES_SECRET }}

- name: Cache dependencies
uses: actions/cache@v1
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: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/filesystem:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-suggest
- name: Run Tests
run: vendor/bin/phpunit

0 comments on commit fd89229

Please sign in to comment.