add permissions #10
Workflow file for this run
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: | |
| pull-requests: write | |
| jobs: | |
| tests: | |
| name: Tests | |
| runs-on: ubuntu-24.04 | |
| if: "!contains(github.event.head_commit.message, '[no-ci]')" | |
| 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: Set up MySQL | |
| run: | | |
| sudo /etc/init.d/mysql start | |
| mysql -e 'CREATE DATABASE `job-board-test`;' -uroot -proot | |
| - name: Setup default environment | |
| run: cp .env.example .env | |
| - name: Update .env file | |
| run: sed -i 's/^DB_PASSWORD=.*/DB_PASSWORD=root/' .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 | |
| 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 |