GitHub Actions automates tasks that run when events happen in your repo, like testing on every push or deploying on merge to main.
.github/workflows/actions/checkout)# .github/workflows/test.yml
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
- name: Install dependencies
run: composer install
- name: Run tests
run: ./vendor/bin/phpunit