Merge pull request #91 from RonasIT/yburlakov-redundant-env-variables #152
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: Run tests with coverage | |
on: | |
push: | |
branches: ["development"] | |
pull_request: | |
branches: ["development"] | |
jobs: | |
test-with-coverage: | |
runs-on: ubuntu-latest | |
env: | |
DB_CONNECTION: pgsql | |
DB_HOST: localhost | |
DB_PASSWORD: "" | |
DB_USERNAME: forge | |
DB_DATABASE: forge | |
REDIS_HOST: localhost | |
REDIS_PASSWORD: "" | |
REDIS_PORT: 6379 | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: "" | |
POSTGRES_USER: forge | |
POSTGRES_DB: forge | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
redis: | |
image: redis:7.2 | |
env: | |
ALLOW_EMPTY_PASSWORD: yes | |
ports: | |
- 6379:6379 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
extensions: pgsql | |
- uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
- name: Execute unit tests via PHPUnit with coverage | |
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml | |
env: | |
DB_PORT: ${{ job.services.postgres.ports[5432] }} | |
- name: Upload coverage results to Coveralls | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
composer global require php-coveralls/php-coveralls | |
php-coveralls --coverage_clover=build/logs/clover.xml -v |