Skip to content

Commit

Permalink
Update github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts committed Mar 27, 2024
1 parent 04ee73f commit 016a149
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
58 changes: 30 additions & 28 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
63 changes: 35 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 016a149

Please sign in to comment.