From 947efa4c36c4318ca3b4ea550c3eeb91efeb443c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 3 Aug 2020 18:43:36 +0200 Subject: [PATCH] Enhancement: Run phpstan on GitHub Actions --- .github/workflows/build.yaml | 36 ++++++++++++++++++++++++++++++++---- .travis.yml | 3 --- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 958cb47..8ca5d00 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,11 +9,39 @@ on: - master jobs: - hello: - name: Hello + static-analysis: + name: Static Analysis runs-on: ubuntu-latest + strategy: + matrix: + php-version: + - 7.2 + steps: - - name: Echo a greeting - run: echo 'Hello, GitHub Actions!' + - name: Checkout + uses: actions/checkout@v2 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + coverage: none + php-version: ${{ matrix.php-version }} + + - name: Determine composer cache directory + id: determine-composer-cache-directory + run: echo "::set-output name=directory::$(composer config cache-dir)" + + - name: Cache dependencies installed with composer + uses: actions/cache@v2 + with: + path: ${{ steps.determine-composer-cache-directory.outputs.directory }} + key: php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }} + restore-keys: php-${{ matrix.php-version }}-composer- + + - name: Install dependencies + run: composer install --no-interaction + + - name: Run phpstan/phpstan + run: vendor/bin/phpstan analyse diff --git a/.travis.yml b/.travis.yml index 2bd79d4..3879f65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,9 +16,6 @@ script: ./vendor/bin/phpunit jobs: include: - - stage: Static analysis - script: vendor/bin/phpstan analyse - - stage: Coding standards script: ./vendor/bin/php-cs-fixer fix -v --diff --dry-run