Week 11 review #21
This file contains hidden or 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: CI | |
| on: | |
| - push | |
| - pull_request | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| tests: | |
| name: Tests | |
| runs-on: ubuntu-24.04 | |
| if: "!contains(github.event.head_commit.message, '[no-ci]')" | |
| services: | |
| mysql: | |
| image: mysql:8.4 | |
| env: | |
| MYSQL_DATABASE: job-board-test | |
| MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping --silent" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=3 | |
| steps: | |
| - name: Code checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.1' | |
| tools: composer:v2 | |
| coverage: xdebug | |
| - name: Setup default environment | |
| run: cp .env.example .env | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: composer-${{ hashFiles('composer.lock') }} | |
| - name: Install PHP Dependencies | |
| run: composer install --no-interaction --no-scripts --no-progress --prefer-dist | |
| - name: CI Cache | |
| run: composer run ci-cache | |
| - name: Run PHP Composer CI tools | |
| run: composer ci | |
| - name: Code Coverage Summary Report | |
| uses: irongut/[email protected] | |
| with: | |
| filename: coverage.cobertura.xml | |
| format: markdown | |
| output: both | |
| - name: Add Coverage PR Comment | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| recreate: true | |
| path: code-coverage-results.md |