diff --git a/.editorconfig b/.editorconfig index c8ebd2b..efbc909 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,4 +6,7 @@ end_of_line = lf indent_style = space indent_size = 4 trim_trailing_whitespace = true -insert_final_newline = true \ No newline at end of file +insert_final_newline = true + +[.github/workflows/**.{yml,yaml}] +indent_size = 2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 44d5cc4..923345b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,6 @@ on: jobs: unitTests: strategy: - max-parallel: 4 matrix: operatingSystem: [ubuntu-latest, windows-latest] phpVersion: ['8.1', '8.2', '8.3'] @@ -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