Skip to content

Commit

Permalink
Use Github Actions to run CI checks (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
webignition committed Feb 18, 2022
1 parent 9d55689 commit c64c450
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 2,022 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Coding Standards

on:
push:
branches:
- master
pull_request:

jobs:
phpcs:
name: PHPCS - PHP ${{ matrix.php }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php: ['7.4', '8.0', '8.1']
runs-on: ${{ matrix.operating-system }}

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

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

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run
run: composer cs-phpcs
19 changes: 19 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Static Analysis

on:
push:
branches:
- master
pull_request:

jobs:
actionlint:
name: Actionlint
runs-on: ubuntu-latest

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

- name: Run actionlint
run: docker run --rm -v "$PWD:/repo" --workdir /repo rhysd/actionlint:latest -color
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests

on:
push:
branches:
- master
pull_request:

jobs:
unit:
name: Unit tests - PHP ${{ matrix.php }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php: ['7.4', '8.0', '8.1']
runs-on: ${{ matrix.operating-system }}

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

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

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run PHPUnit unit tests
run: composer test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/build
/vendor
/docs/_build/
composer.lock
.phpunit.result.cache
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,24 @@
}
},
"scripts": {
"cs-phpcs": "./vendor/bin/phpcs",
"cs": [
"@cs-phpcs"
],
"test": "./vendor/bin/phpunit --colors=always",
"cs": "./vendor/bin/phpcs src tests --colors --standard=PSR2",
"ci": [
"@composer cs",
"@composer test"
]
},
"require": {
"php": ">=7.2",
"php": "^7.4|^8.0|^8.1",
"psr/http-message": "^1",
"algo26-matthias/idna-convert": "^2",
"algo26-matthias/idna-convert": "^3.0",
"hookedmedia/ip-utils": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "^7",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "3.*",
"mockery/mockery": "^1",
"php-mock/php-mock-mockery": "^1"
Expand Down

0 comments on commit c64c450

Please sign in to comment.