add: simple DI container with test #5
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: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
paths-ignore: | |
- '**/README.md' | |
jobs: | |
tests-and-check-format: | |
runs-on: ubuntu-latest | |
env: | |
XDEBUG_MODE: coverage | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Composer install | |
uses: php-actions/composer@v6 | |
with: | |
php_version: "8.1" | |
version: 2.x | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/composer-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
- name: Run PHP_CodeSniffer | |
run: vendor/bin/phpcs | |
- name: Run PHPUnit tests | |
run: make coverage | |
- name: Generate coverage badge | |
uses: timkrase/[email protected] | |
with: | |
report_type: clover | |
report: 'coverage.xml' | |
coverage_badge_path: 'badge.svg' | |
push_badge: true | |
repo_token: ${{ secrets.GITHUB_TOKEN }} |