Merge pull request #1355 from datamweb/fix-phpstan-errors #51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: StructArmed | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| paths: | |
| - '**.php' | |
| - 'composer.*' | |
| - 'structarmed.php' | |
| - '.github/workflows/structarmed.yml' | |
| push: | |
| branches: | |
| - develop | |
| paths: | |
| - '**.php' | |
| - 'composer.*' | |
| - 'structarmed.php' | |
| - '.github/workflows/structarmed.yml' | |
| workflow_call: | |
| inputs: | |
| php-version: | |
| required: false | |
| type: string | |
| default: '8.2' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Dependency Tracing | |
| runs-on: ubuntu-latest | |
| if: (! contains(github.event.head_commit.message, '[ci skip]')) | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 | |
| with: | |
| php-version: ${{ inputs['php-version'] }} | |
| tools: composer | |
| extensions: intl, json, mbstring, xml | |
| coverage: none | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get composer cache directory | |
| run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV | |
| - name: Cache composer dependencies | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0 | |
| with: | |
| path: ${{ env.COMPOSER_CACHE_FILES_DIR }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: | | |
| if [ -f composer.lock ]; then | |
| composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader | |
| else | |
| composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader | |
| fi | |
| - name: Structarmed Cache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: /tmp/structarmed | |
| key: ${{ runner.os }}-structarmed-${{ github.run_id }} | |
| restore-keys: ${{ runner.os }}-structarmed- | |
| - run: mkdir -p /tmp/structarmed | |
| - name: Run static analysis | |
| run: vendor/bin/structarmed analyze |