Skip to content

Commit

Permalink
Include PHPStan testing in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Apr 9, 2024
1 parent e15de41 commit 2a5d584
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ end_of_line = lf
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
insert_final_newline = true

[.github/workflows/**.{yml,yaml}]
indent_size = 2
40 changes: 39 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
jobs:
unitTests:
strategy:
max-parallel: 4
matrix:
operatingSystem: [ubuntu-latest, windows-latest]
phpVersion: ['8.1', '8.2', '8.3']
Expand Down Expand Up @@ -56,3 +55,42 @@ jobs:

- name: Run tests
run: composer run test

staticAnalysis:
runs-on: ubuntu-latest
name: Static Analysis
env:
extensions: curl, fileinfo, openssl, zip
key: winter-packager-v1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-phpstan
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

steps:
- name: Checkout changes
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer:v2
extensions: ${{ env.extensions }}

- name: Setup dependency cache
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --no-scripts

- name: Run tests
run: ./vendor/bin/phpstan analyse

0 comments on commit 2a5d584

Please sign in to comment.