Skip to content

Commit

Permalink
Use GitHub actions instead of Travis
Browse files Browse the repository at this point in the history
Also integrates Codecov.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
  • Loading branch information
henriquemoody committed Mar 20, 2023
1 parent 7c61969 commit 6b17659
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 53 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Continuous Integration

on:
push:
paths-ignore:
- 'bin/**'
pull_request:
paths-ignore:
- 'bin/**'

jobs:
tests:
name: Tests

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- "8.1"
- "8.2"

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none

- name: Install Dependencies
run: composer install --prefer-dist

- name: Run Unit Tests
run: ./vendor/bin/phpunit --testsuite=unit

- name: Run Integration Tests
run: ./vendor/bin/phpunit --testsuite=integration

code-coverage:
name: Code coverage

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: pcov

- name: Install Dependencies
run: composer install --prefer-dist

- name: Generating Code Coverage Report
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Send Code Coverage Report to Codecov.io
uses: codecov/codecov-action@v3

static-analysis:
name: Static Analysis

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none

- name: Install dependencies
run: composer install --prefer-dist

- name: Run DocHeader
run: vendor/bin/docheader check library/ tests/

- name: Run PHP_CodeSniffer
run: vendor/bin/phpcs

- name: Run PHPStan
run: vendor/bin/phpstan analyze
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Respect\Assertion

[![Build Status](https://img.shields.io/travis/Respect/Assertion/master.svg?style=flat-square)](http://travis-ci.org/Respect/Assertion)
[![Latest Version](https://img.shields.io/packagist/v/respect/assertion.svg?style=flat-square)](https://packagist.org/packages/respect/assertion)
[![Build Status](https://img.shields.io/github/actions/workflow/status/Respect/Assertion/continuous-integration.yml?branch=master&style=flat-square)](https://github.com/Respect/Assertion/actions/workflows/continuous-integration.yml)
[![Code Coverage](https://img.shields.io/codecov/c/github/Respect/Assertion?style=flat-square)](https://codecov.io/gh/Respect/Assertion)
[![Latest Stable Version](https://img.shields.io/packagist/v/respect/assertion.svg?style=flat-square)](https://packagist.org/packages/respect/assertion)
[![Total Downloads](https://img.shields.io/packagist/dt/respect/assertion.svg?style=flat-square)](https://packagist.org/packages/respect/assertion)
[![License](https://img.shields.io/packagist/l/respect/assertion.svg?style=flat-square)](https://packagist.org/packages/respect/assertion)

Expand Down

0 comments on commit 6b17659

Please sign in to comment.