Skip to content

Commit

Permalink
Move to Github Actions from Travis CI
Browse files Browse the repository at this point in the history
Add the following workflows:
- Unit Tests - phpunit
- Coding Standards - phpcs
- Coverage - run tests with coverage and upload to coveralls
  • Loading branch information
michalbundyra committed Mar 1, 2021
1 parent b69f5f4 commit b28fbee
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 64 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Coverage

on: [push, pull_request]

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4

- name: Install dependencies
run: composer install --no-progress --no-suggest --optimize-autoloader

- name: Add coveralls dependency
run: composer require --dev php-coveralls/php-coveralls --no-progress --no-suggest --no-interaction

- name: Run tests with coverage
run: composer test-coverage

- name: Upload coverage to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php vendor/bin/php-coveralls -v
24 changes: 24 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Coding Standards

on: [push, pull_request]

jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4

- name: Validate composer.json
run: composer validate --strict

- name: Install dependencies
run: composer install --no-progress --no-suggest --optimize-autoloader

- name: Run CS checks
run: composer cs-check
31 changes: 31 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Unit Tests

on: [push, pull_request]

jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 15
matrix:
dependencies: ['lowest', 'latest']
php-versions: ['7.3', '7.4', '8.0']
name: PHP ${{ matrix.php-versions }}, ${{ matrix.dependencies }} dependencies
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}

- name: Install dependencies
env:
DEPS: ${{ matrix.dependencies }}
run: |
if [[ $DEPS != 'lowest' ]]; then composer update --no-progress --no-suggest --prefer-lowest --prefer-stable --optimize-autoloader ; else composer update --no-progress --no-suggest --prefer-dist --optimize-autoloader ; fi
- name: Run tests
run: composer test
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Webimpress Coding Standard

[![Build Status](https://travis-ci.com/webimpress/coding-standard.svg?branch=master)](https://travis-ci.com/webimpress/coding-standard)
[![Unit Tests](https://github.com/webimpress/coding-standard/actions/workflows/phpunit.yml/badge.svg)](https://github.com/webimpress/coding-standard/actions/workflows/phpunit.yml)
[![Coding Standards](https://github.com/webimpress/coding-standard/actions/workflows/phpcs.yml/badge.svg)](https://github.com/webimpress/coding-standard/actions/workflows/phpcs.yml)
[![Coverage Status](https://coveralls.io/repos/github/webimpress/coding-standard/badge.svg?branch=master)](https://coveralls.io/github/webimpress/coding-standard?branch=master)

## Installation
Expand Down

0 comments on commit b28fbee

Please sign in to comment.