Skip to content

Commit

Permalink
- Add github actions with new badge on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ianriizky committed Dec 30, 2021
1 parent 9828495 commit 1a382e7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on: push

name: tests

jobs:
phpunit:
runs-on: ubuntu-latest

steps:
- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: xdebug

- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer install --no-scripts

- name: Execute tests
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- name: Upload Scrutinizer coverage
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/logs/clover.xml"

- 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Kumpulan Coding Interview

[![Build Status](https://github.com/ianriizky/coding-interview/workflows/tests/badge.svg)](https://github.com/ianriizky/coding-interview/actions)
[![Quality Score](https://img.shields.io/scrutinizer/g/ianriizky/coding-interview.svg?style=flat)](https://scrutinizer-ci.com/g/ianriizky/coding-interview)
[![Coverage Status](https://coveralls.io/repos/github/ianriizky/coding-interview/badge.svg)](https://coveralls.io/github/ianriizky/coding-interview)
[![Latest Stable Version](https://poser.pugx.org/ianriizky/coding-interview/v/stable.svg)](https://packagist.org/packages/ianriizky/coding-interview)
Expand Down

0 comments on commit 1a382e7

Please sign in to comment.