Skip to content

Commit

Permalink
Add github workflow
Browse files Browse the repository at this point in the history
Also add script shortcut for phpunit in composer.json
  • Loading branch information
codemedic committed Aug 14, 2020
1 parent 593b6bd commit a8e9631
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PHP Composer

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run test suite
run: composer run-script test
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
"phpdoc-md": [
"@php vendor/bin/phpdoc-md generate src > docs/phpdoc.md",
"@php scripts/phpdoc-md-fix-anchors.php docs/phpdoc.md"
]
],
"test": "phpunit"
},
"scripts-descriptions": {
"phpdoc-md": "Generate markdown from phpdoc comments"
"phpdoc-md": "Generate markdown from phpdoc comments",
"phpunit": "Run PHPUnit tests"
},
"license": "MIT",
"authors": [
Expand Down

0 comments on commit a8e9631

Please sign in to comment.