-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from Hi-Folks/upgrade/larastan-gh-actions
Upgrading Larastan GH actions
- Loading branch information
Showing
8 changed files
with
96 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: hi-folks/ghygen | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- features/** | ||
- upgrade/** | ||
|
||
jobs: | ||
laravel-tests: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
operating-system: [ubuntu-latest] | ||
php-versions: [ '8.2' ] | ||
dependency-stability: [ 'prefer-none' ] | ||
|
||
name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
- name: Install NPM packages | ||
run: npm i | ||
- name: Build frontend | ||
run: npm run build | ||
- name: Install PHP versions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
- name: Copy .env | ||
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | ||
- name: Install Dependencies | ||
if: steps.vendor-cache.outputs.cache-hit != 'true' | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
|
||
- name: Update Dependencies with latest stable | ||
if: matrix.dependency-stability == 'prefer-stable' | ||
run: composer update --prefer-stable | ||
- name: Update Dependencies with lowest stable | ||
if: matrix.dependency-stability == 'prefer-lowest' | ||
run: composer update --prefer-stable --prefer-lowest | ||
|
||
- name: Generate key | ||
run: php artisan key:generate | ||
- name: Directory Permissions | ||
run: chmod -R 777 storage bootstrap/cache | ||
- name: Run Migrations | ||
# Set environment | ||
env: | ||
SESSION_DRIVER: array | ||
DB_CONNECTION: sqlite | ||
DB_DATABASE: ":memory:" | ||
|
||
run: php artisan migrate | ||
|
||
- name: Show dir | ||
run: pwd | ||
- name: PHP Version | ||
run: php --version | ||
|
||
# Code quality | ||
|
||
- name: Execute tests (Unit and Feature tests) via PestPHP | ||
# Set environment | ||
env: | ||
SESSION_DRIVER: array | ||
DB_CONNECTION: sqlite | ||
DB_DATABASE: ":memory:" | ||
|
||
run: vendor/bin/pest | ||
|
||
|
||
|
||
- name: Execute Code Static Analysis (PHP Stan + Larastan) | ||
run: | | ||
vendor/bin/phpstan analyse -c ./phpstan.neon --no-progress | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
- name: Execute Code Static Analysis (PHP Stan + Larastan) | ||
run: | | ||
composer require --dev nunomaduro/larastan | ||
vendor/bin/phpstan analyse app -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress | ||
composer require --dev larastan/larastan | ||
vendor/bin/phpstan analyse app -c ./vendor/larastan/larastan/extension.neon --level=4 --no-progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
- name: Execute Code Static Analysis (PHP Stan + Larastan) | ||
run: | | ||
vendor/bin/phpstan analyse app -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress | ||
vendor/bin/phpstan analyse app -c ./vendor/larastan/larastan/extension.neon --level=4 --no-progress |