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
name: Build and Test PHP | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: [7.4, 8.0, 8.1] # List of PHP versions to test | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: mbstring, intl | |
- name: Install Composer dependencies | |
run: composer install --no-progress --prefer-dist | |
- name: Run PHP tests | |
run: vendor/bin/phpunit # Adjust if you're using a different test runner | |
- name: Build project | |
run: php artisan build # Adjust based on your framework or build process |