Skip to content

Initial Commit

Initial Commit #1

Workflow file for this run

name: Quality Checks
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
PHP_VERSION: "8.3"
jobs:
setup:
name: Setup Environment
runs-on: ubuntu-latest
outputs:
composer-cache-dir: ${{ steps.composer-cache.outputs.dir }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install PHP v${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
tools: composer:v2
coverage: none
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
test-and-lint:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
task: [test, lint]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Composer Cache
uses: actions/cache@v3
with:
path: ${{ needs.setup.outputs.composer-cache-dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Prepare Application
run: cp .env.ci .env
- name: Start Application
run: |
make build && make start
sleep 30s # Wait for services to initialize
- name: Setup Database
if: matrix.task == 'test'
run: |
make migrate
make seed
- name: Run Tests
if: matrix.task == 'test'
run: vendor/bin/phpunit
- name: Run Linter
if: matrix.task == 'lint'
run: vendor/bin/php-cs-fixer