Skip to content

Commit

Permalink
Replace Travis with GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed May 31, 2021
1 parent da24035 commit 5bf3567
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Expand Up @@ -14,3 +14,6 @@ indent_style = space
[{*.neon,*.yml}]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
4 changes: 3 additions & 1 deletion .gitattributes
@@ -1,7 +1,9 @@
* text=auto

.editorconfig export-ignore
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
.travis.yml export-ignore
Makefile export-ignore
phpcs.xml export-ignore
phpstan.neon export-ignore
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/coding-standards.yml
@@ -0,0 +1,22 @@
name: coding-standards

on:
- push
- pull_request

jobs:
PSR-12:
name: PSR-12
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: "7.2"
ini-values: memory_limit=-1
tools: phpcs, cs2pr
- name: Run PHP Code Sniffer
run: phpcs -q --report=checkstyle | cs2pr
38 changes: 38 additions & 0 deletions .github/workflows/phpstan.yml
@@ -0,0 +1,38 @@
name: analyze

on:
- push
- pull_request

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-20.04
strategy:
matrix:
php-version:
- "7.2"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
tools: composer:v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}"
restore-keys: "php-${{ matrix.php-version }}"

- name: Install dependencies
run: composer install --no-interaction --no-progress

- name: Analyze
run: vendor/bin/phpstan analyse
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,55 @@
name: test

on:
- push
- pull_request

jobs:
phpunit:
name: phpunit
runs-on: ubuntu-20.04
strategy:
matrix:
dependencies:
- lowest
- highest
php-version:
- "7.2"
- "7.4"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
tools: composer:v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}"
restore-keys: "php-${{ matrix.php-version }}"

- name: Install dependencies, lowest
if: ${{ matrix.dependencies == 'lowest' }}
run: composer update --prefer-lowest --no-interaction --no-progress

- name: Install dependencies, highest
if: ${{ matrix.dependencies == 'highest' }}
run: composer update --no-interaction --no-progress

- name: Run PHPUnit
run: make test-coveralls

- name: Upload code coverage
if: ${{ matrix.php-version == '7.2' }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
@@ -1,7 +1,7 @@
The icanboogie/message-bus package is free software.
It is released under the terms of the following BSD License.

Copyright (c) 2017-2020 by Olivier Laviale
Copyright (c) 2017-2021 by Olivier Laviale
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Expand Up @@ -11,11 +11,11 @@ usage:
@echo "test: Runs the test suite.\ndoc: Creates the documentation.\nclean: Removes the documentation, the dependencies and the Composer files."

vendor:
@COMPOSER_ROOT_VERSION=$(PACKAGE_VERSION) composer install
@composer install

.PHONY: update
update:
@COMPOSER_ROOT_VERSION=$(PACKAGE_VERSION) composer update
@composer update

test-dependencies: vendor

Expand All @@ -24,7 +24,7 @@ test: test-dependencies
@$(PHPUNIT)

.PHONY: test-coverage
test-coverage: test-dependencies
test-coverage: vendor
@mkdir -p build/coverage
@$(PHPUNIT) --coverage-html build/coverage

Expand All @@ -44,14 +44,14 @@ $(PHPCS_FILENAME):

lint: vendor $(PHPCS_FILENAME)
$(PHPCS_FILENAME)
./vendor/bin/phpstan analyse
vendor/bin/phpstan analyse

doc: vendor
@mkdir -p build/docs
@apigen generate \
--source lib \
--destination build/docs/ \
--title "$(PACKAGE_NAME) v$(PACKAGE_VERSION)" \
--title "$(PACKAGE_NAME)" \
--template-theme "bootstrap"

.PHONY: clean
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
# MessageBus

[![Packagist](https://img.shields.io/packagist/v/icanboogie/message-bus.svg)](https://packagist.org/packages/icanboogie/message-bus)
[![Build Status](https://img.shields.io/travis/ICanBoogie/MessageBus.svg)](http://travis-ci.org/ICanBoogie/MessageBus)
[![Build Status](https://img.shields.io/github/workflow/status/ICanBoogie/MessageBus/test)](https://github.com/ICanBoogie/MessageBus/actions?query=workflow%3Atest)
[![Code Quality](https://img.shields.io/scrutinizer/g/ICanBoogie/MessageBus.svg)](https://scrutinizer-ci.com/g/ICanBoogie/MessageBus)
[![Code Coverage](https://img.shields.io/coveralls/ICanBoogie/MessageBus.svg)](https://coveralls.io/r/ICanBoogie/MessageBus)
[![Downloads](https://img.shields.io/packagist/dt/icanboogie/message-bus.svg)](https://packagist.org/packages/icanboogie/message-bus/stats)
Expand Down

0 comments on commit 5bf3567

Please sign in to comment.