Skip to content

Commit

Permalink
Add coverage (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMY3 authored Aug 18, 2022
1 parent 27aeec1 commit 4436697
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 140 deletions.
3 changes: 2 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src_dir: ./
coverage_clover: tests/result/coverage/*.xml
json_path: tests/result/coveralls-upload.json
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
- name: Run PHPUnit Tests
run: docker-compose exec -T php vendor/bin/phpunit

- uses: codecov/codecov-action@v3
- name: Upload coverage results to Coveralls
run: docker-compose exec -e COVERALLS_REPO_TOKEN="${{ secrets.COVERALLS_REPO_TOKEN }}" -T php vendor/bin/php-coveralls -v
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ composer.phar
composer.lock
vendor/
/node_modules/
/build/
/tests/result/
.idea
.phpunit.result.cache
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fresque

[![Coverage Status](https://codecov.io/gh/freelancehunt/fresque/branch/master/graph/badge.svg)](https://codecov.io/gh/freelancehunt/fresque)
[![Coverage Status](https://coveralls.io/repos/github/freelancehunt/fresque/badge.svg?branch=add-coverage)](https://coveralls.io/github/freelancehunt/fresque?branch=add-coverage)
[![PHP from Packagist](https://img.shields.io/packagist/php-v/freelancehunt/fresque.svg)](https://packagist.org/packages/freelancehunt/fresque)
[![Packagist](https://img.shields.io/packagist/v/freelancehunt/fresque.svg)](https://packagist.org/packages/freelancehunt/fresque)
[![Packagist](https://img.shields.io/packagist/dt/freelancehunt/fresque.svg)](https://packagist.org/packages/freelancehunt/fresque)
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
working_dir: /app
volumes:
- "./:/app:cached"
environment:
- XDEBUG_MODE=coverage

redis:
image: "redis:alpine"
Expand Down
4 changes: 2 additions & 2 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM php:8.1-fpm

RUN apt-get update && apt-get install -y procps && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y procps git && rm -rf /var/lib/apt/lists/*

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions redis posix pcntl zip
install-php-extensions redis posix pcntl zip xdebug
5 changes: 2 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
</include>
<exclude>
<directory suffix=".php">./vendor/</directory>
<directory suffix=".php">./tests</directory>
<directory suffix=".php">./tests/</directory>
<file>./src/init.php</file>
<file>./src/Fresque/DialogMenuValidator.php</file>
<file>./src/Fresque/SendSignalCommandOptions.php</file>
<file>./src/Fresque/ResqueStats.php</file>
</exclude>
<report>
<clover outputFile="./build/logs/clover.xml"/>
<html outputDirectory="./build/coverage"/>
<clover outputFile="tests/result/coverage/clover.xml"/>
</report>
</coverage>
<testsuites>
Expand Down
Loading

0 comments on commit 4436697

Please sign in to comment.