Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save abenevaut/c86ab8d559b92f2d93b028a0e6e832d9 to your computer and use it in GitHub Desktop.
Save abenevaut/c86ab8d559b92f2d93b028a0e6e832d9 to your computer and use it in GitHub Desktop.

Github Actions are defined in a YAML file named <workflow name>.yml and are listed in the .github/workflows folder at the root of your project. You can store as many workflows as your project requires.

name: test-my-laravel-project
on:
pull_request:
branches: [ master ]
env:
php_version: 8.3
jobs:
test:
runs-on: ubuntu-latest
concurrency:
group: test-my-laravel-project-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Initialize PHP ${{ env.php_version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php_version }}
coverage: pcov
- name: Composer install
run: |
composer validate --strict
composer install --optimize-autoloader --no-interaction --prefer-dist
- name: Test
run: php artisan test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment