Fixed code analysis script #562
Workflow file for this run
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
| on: pull_request | |
| name: Review | |
| jobs: | |
| changelog: | |
| runs-on: ubuntu-latest | |
| name: Changelog should be updated | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Git fetch | |
| run: git fetch | |
| - name: Check that changelog has been updated. | |
| run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0 | |
| validate-composer-files: | |
| name: Validate composer | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Mark repo as safe for git (container) | |
| run: | | |
| docker compose run --rm --user 0 php bash -lc \ | |
| 'git config --system --add safe.directory /app || git config --global --add safe.directory /app' | |
| - name: Fix ownership (container) | |
| run: | | |
| docker compose run --rm --user 0 -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) php bash -lc 'chown -R ${HOST_UID}:${HOST_GID} /app' | |
| - name: Validate composer files | |
| run: | | |
| docker compose run --rm --user "$(id -u):$(id -g)" php composer validate composer.json | |
| - name: Check that composer file is normalized | |
| run: | | |
| docker compose run --rm --user "$(id -u):$(id -g)" php composer install | |
| docker compose run --rm --user "$(id -u):$(id -g)" php composer normalize --dry-run | |
| test-composer-files: | |
| name: Test composer files | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| dependency-version: [ prefer-lowest, prefer-stable ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Fix ownership (container) | |
| run: | | |
| docker compose run --rm --user 0 -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) php bash -lc 'chown -R ${HOST_UID}:${HOST_GID} /app' | |
| - name: Debug compose + php | |
| run: | | |
| ls -la | |
| docker compose config | |
| docker compose run --rm php php -v | |
| - name: Check that dependencies resolve. | |
| run: | | |
| rm -fr vendor/ | |
| docker compose run --rm --user "$(id -u):$(id -g)" php composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction | |
| php-coding-standards: | |
| name: PHP coding standards | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Fix ownership (container) | |
| run: | | |
| docker compose run --rm --user 0 -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) php bash -lc 'chown -R ${HOST_UID}:${HOST_GID} /app' | |
| - name: Install Dependencies | |
| run: | | |
| docker compose run --rm --user "$(id -u):$(id -g)" php composer install | |
| - name: PHPCS | |
| run: | | |
| docker compose run --rm --user "$(id -u):$(id -g)" php composer coding-standards-check/phpcs | |
| php-code-analysis: | |
| name: PHP code analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Fix ownership (container) | |
| run: | | |
| docker compose run --rm --user 0 -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) php bash -lc 'chown -R ${HOST_UID}:${HOST_GID} /app' | |
| - name: Code analysis | |
| run: | | |
| ./scripts/code-analysis | |
| coding-standards-markdown: | |
| name: Markdown coding standards | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Coding standards | |
| run: | | |
| docker compose run --rm markdownlint markdownlint '**/*.md' |