Skip to content

Commit

Permalink
Create a workflow to produce code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
duncan3dc committed Aug 25, 2019
1 parent d0b5183 commit e220ff1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on: push

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Create Docker Container
run: |
docker build . -t ci-image --build-arg PHP_VERSION=7.3
docker run --interactive --detach \
--volume ${{ github.workspace }}:/app \
--env CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} \
--name ci ci-image
- name: Install Dependencies
run: docker exec ci composer update --no-interaction --no-ansi --prefer-dist

- name: PHPUnit
run: docker exec ci vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Code Coverage
run: docker exec ci bash -c "bash <(curl -s https://codecov.io/bash)"
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM php:${PHP_VERSION}-cli

RUN apt-get update && apt-get install -y libxml2-dev && docker-php-ext-install soap
RUN docker-php-ext-install sockets
RUN pecl install xdebug && docker-php-ext-enable xdebug

# Install composer to manage PHP dependencies
RUN apt-get update && apt-get install -y git zip
Expand Down

0 comments on commit e220ff1

Please sign in to comment.