Add Psalm to GitHub Actions

This commit is contained in:
Oliver Davies 2020-06-05 22:09:51 +01:00
parent 259946d961
commit 0ed99797f5
3 changed files with 37 additions and 1 deletions

31
.github/workflows/static-analysis.yml vendored Normal file
View file

@ -0,0 +1,31 @@
---
name: Static analysis
on:
pull_request:
push:
paths:
- '**.php'
- '*psalm.xml'
jobs:
psalm:
name: Psalm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: 7.4
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v1
with:
path: vendor
key: composer-${{ hashFiles('composer.lock' )}}
- name: Run Psalm
run: make static-code-analysis

View file

@ -1,6 +1,6 @@
.PHONY: *
static-code-analysis:
static-code-analysis: vendor
php vendor/bin/psalm --show-info=true
phpcs:
@ -10,3 +10,7 @@ phpunit:
php vendor/bin/phpunit -v --color=always --testdox tests
test: phpunit phpcs
vendor: composer.json
composer validate --strict
composer install

View file

@ -1,5 +1,6 @@
{
"name": "opdavies/glassboxx-sdk-php",
"description": "A PHP SDK for creating customers and orders in Glassboxx.",
"type": "library",
"license": "MIT",
"authors": [