Skip to content

#5 - add rabbitmq and examples #44

#5 - add rabbitmq and examples

#5 - add rabbitmq and examples #44

Workflow file for this run

name: Test&lint PHP codebase
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test-and-lint-php:
name: Test&lint PHP codebase
runs-on: ubuntu-20.04
services:
pgsql:
image: postgres:15
env:
POSTGRES_DB: slim
POSTGRES_USER: slim
POSTGRES_PASSWORD: password
PGPASSWORD: password
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-composer-dependencies-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-dependencies
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, intl
coverage: xdebug
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-suggest
- name: Run PHP linter
run: composer cs:check
- name: Run PHPSTAN
run: composer phpstan
- name: Execute Architecture tests
run: |
composer test:architecture
- name: Execute tests
run: |
cp .env.test .env
composer migrate
vendor/bin/phpunit --testsuite unit --fail-on-incomplete --log-junit junit.xml --coverage-clover clover.xml
- name: Send test coverage to codecov.io
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: clover.xml
fail_ci_if_error: true
verbose: true