.github/workflows/tests.yml
name: tests
on:
push:
pull_request:
types: [opened, synchronize]
jobs:
tests:
name: tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: '8.2'
extensions: mbstring, bcmath
coverage: xdebug
- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader
- name: Laravel env
run: |
cp .env.example .env
php artisan key:generate
- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v3.2.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: vendor/bin/phpunit
- name: Deploy
if: success() && (github.event_name != 'pull_request')
run: curl -s "${{ secrets.FORGE }}"