Skip to content

feat(emails): implement send email functionality #1

feat(emails): implement send email functionality

feat(emails): implement send email functionality #1

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main # Only trigger workflows on PRs targeting the protected main branch
permissions:
contents: read # Limit token to read-only access for improved security
jobs:
build:
runs-on: ubuntu-latest # Use the latest Ubuntu runner for consistency and updates
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Fetch the full commit history so that head refs from forks are always available,
# preventing "ref not found" errors on shallow clones.
fetch-depth: 0
# Explicitly target the fork repository to ensure the correct remote is used for checkout.
repository: ${{ github.event.pull_request.head.repo.full_name }}
# Use the contributor's branch ref to run tests against the exact PR code.
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
# Pin a specific PHP version to guarantee reproducible builds.
php-version: '8.3'
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
# Cache vendor directory between runs to reduce install time and improve performance.
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-suggest --no-progress
# --prefer-dist ensures distribution archives are used over VCS clones,
# --no-suggest skips optional suggestions for faster installs,
# --no-progress cleans up logs for readability.
- name: Run PHPUnit tests
run: vendor/bin/phpunit --configuration phpunit.xml
# Exit code will fail the job on test failures, ensuring broken code is caught.
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v5
with:
# Use the built-in GITHUB_TOKEN to authenticate uploads securely.
token: ${{ secrets.GITHUB_TOKEN }}
# Exit on upload failure to surface issues immediately.