Skip to content

Commit

Permalink
Merge pull request #11 from klimov-paul/github-actions
Browse files Browse the repository at this point in the history
Add github workflow + Laravel 9 support
  • Loading branch information
vpratfr authored Feb 16, 2022
2 parents c4b743d + e18f7c2 commit ccdbe76
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ignore all test and documentation for archive
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/docs export-ignore
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### What steps will reproduce the problem?

### What is the expected result?

### What do you get instead?

### Additional info

| Q | A
| ------------------------- | ---
| This Package Version | 1.?.?
| Laravel Framework Version | 9.?.?
| PHP version |
| Operating system |
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
| Q | A
| ------------- | ---
| Is bugfix? | ✔️/❌
| New feature? | ✔️/❌
| Breaks BC? | ✔️/❌
| Tests pass? | ✔️/❌
| Fixed issues | comma-separated list of tickets # fixed by the PR, if any
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build

on: [push, pull_request]

jobs:
phpunit:
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']

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

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

- name: Install dependencies
run: |
composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Run unit tests
run: vendor/bin/phpunit --verbose --colors=always
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.phar
composer.lock
build
.php_cs.cache
.phpunit.result.cache
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Latest Version on Packagist](https://img.shields.io/packagist/v/marvinlabs/laravel-luhn.svg?style=flat-square)](https://packagist.org/packages/marvinlabs/laravel-luhn)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Total Downloads](https://img.shields.io/packagist/dt/marvinlabs/laravel-luhn.svg?style=flat-square)](https://packagist.org/packages/marvinlabs/laravel-luhn)
[![Build Status](https://github.com/illuminatech/marvinlabs/laravel-luhn/build/badge.svg)](https://github.com/marvinlabs/laravel-luhn/actions)

`marvinlabs/laravel-luhn` is a laravel package providing various Laravel utilities to work with the
Luhn algorithm such as:
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
],
"require": {
"php": ">=7.1",
"illuminate/support": "^5.5|^6.0|^7.0|^8.0"
"illuminate/support": "^5.5|^6.0|^7.0|^8.0|^9.0"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"mockery/mockery": "^0.9",
"orchestra/testbench": "^3.6|^4.0|^5.0"
"mockery/mockery": ">=0.9",
"orchestra/testbench": "^3.6|^4.0|^5.0|^6.0|^7.0"
},
"autoload": {
"psr-4": {
Expand Down
14 changes: 14 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false">
<testsuites>
<testsuite name="Laravel Luhn Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
</phpunit>
6 changes: 3 additions & 3 deletions tests/AlgorithmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AlgorithmTest extends TestCase
{
protected $implementations = [];

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down Expand Up @@ -67,7 +67,7 @@ public function can_validate_input(string $input, bool $expectedResult): void
* @test
* @dataProvider provideCheckDigitTestInput
*/
public function can_compute_check_digit(string $number, bool $expectedResult): void
public function can_compute_check_digit(string $number, int $expectedResult): void
{
foreach ($this->implementations as $name => $instance)
{
Expand All @@ -81,7 +81,7 @@ public function can_compute_check_digit(string $number, bool $expectedResult): v
* @test
* @dataProvider provideCheckSumTestInput
*/
public function can_compute_check_sum(string $number, bool $expectedResult): void
public function can_compute_check_sum(string $number, int $expectedResult): void
{
foreach ($this->implementations as $name => $instance)
{
Expand Down

0 comments on commit ccdbe76

Please sign in to comment.