diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 0000000..1237f14 --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -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 diff --git a/Makefile b/Makefile index 50de742..897d155 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/composer.json b/composer.json index c4227cb..e56c289 100644 --- a/composer.json +++ b/composer.json @@ -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": [