GrumPHP #52
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: GrumPHP | |
on: | |
pull_request: ~ | |
push: ~ | |
schedule: | |
- cron: '0 9 * * 5' | |
permissions: | |
contents: read | |
jobs: | |
run: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ubuntu-latest] | |
php-versions: ['8.1', '8.2', '8.3'] | |
composer-options: ['', '--prefer-lowest'] | |
composer-versions: ['composer:v2'] | |
fail-fast: false | |
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} with ${{ matrix.composer-versions }} ${{ matrix.composer-options }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Install PHP | |
uses: shivammathur/setup-php@master | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: ${{ matrix.composer-versions }} | |
extensions: xdebug, mbstring, posix | |
- name: Check Versions | |
run: | | |
php -v | |
php -m | |
composer --version | |
- name: Get composer cache directory | |
id: composercache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} | |
- name: Start containers | |
run: docker compose -f "docker-compose.yml" up -d --build --wait | |
- name: Set git variables | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Your Name" | |
git config --global protocol.file.allow always | |
- name: Run the tests | |
run: php vendor/bin/grumphp run --no-interaction | |
- name: Stop containers | |
if: always() | |
run: docker compose -f "docker-compose.yml" down |