From: Art4 Date: Sun, 22 Dec 2024 14:29:13 +0000 (+0000) Subject: merge code quality checks into on workflow X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=432f28ecd1e730ba7a770564789f468c9abb7831;p=friendica.git merge code quality checks into on workflow --- diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 0000000000..dad0aec9e1 --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,77 @@ +# SPDX-FileCopyrightText: 2010 - 2024 the Friendica project +# +# SPDX-License-Identifier: CC0-1.0 + +name: Code Quality + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + + code-style: + name: PHP-CS-Fixer (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + operating-system: ['ubuntu-latest'] + php: ['8.3'] + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - name: Setup PHP with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: ${{ matrix.php }} + coverage: xdebug + tools: none + + - name: Clone addon repository + run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon + + - name: Install PHP-CS-Fixer + run: composer install --working-dir=bin/dev/php-cs-fixer + + - name: Run PHP-CS-Fixer + continue-on-error: true + run: bin/dev/php-cs-fixer/vendor/bin/php-cs-fixer fix --diff --dry-run + + phpstan: + name: PHPStan (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + operating-system: ['ubuntu-latest'] + php: ['8.4'] + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - name: Setup PHP with composer and extensions + uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php + with: + php-version: ${{ matrix.php }} + coverage: xdebug + tools: none + + - name: Clone addon repository + run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon + + - name: Install Composer dependencies + uses: "ramsey/composer-install@v2" + + - name: Run PHPStan + run: composer run phpstan diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml deleted file mode 100644 index d7bd23aaa3..0000000000 --- a/.github/workflows/code-style.yml +++ /dev/null @@ -1,45 +0,0 @@ -# SPDX-FileCopyrightText: 2010 - 2024 the Friendica project -# -# SPDX-License-Identifier: CC0-1.0 - -name: Code Style - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - - tests: - name: PHP-CS-Fixer (PHP ${{ matrix.php }}) - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - operating-system: ['ubuntu-latest'] - php: ['8.3'] - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - - name: Setup PHP with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php - with: - php-version: ${{ matrix.php }} - coverage: xdebug - tools: none - - - name: Clone addon repository - run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon - - - name: Install PHP-CS-Fixer - run: composer install --working-dir=bin/dev/php-cs-fixer - - - name: Run PHP-CS-Fixer - continue-on-error: true - run: bin/dev/php-cs-fixer/vendor/bin/php-cs-fixer fix --diff --dry-run \ No newline at end of file diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml deleted file mode 100644 index d3c94de7fd..0000000000 --- a/.github/workflows/phpstan.yml +++ /dev/null @@ -1,44 +0,0 @@ -# SPDX-FileCopyrightText: 2010 - 2024 the Friendica project -# -# SPDX-License-Identifier: CC0-1.0 - -name: Static Code Analysis - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - - tests: - name: PHPStan (PHP ${{ matrix.php }}) - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - operating-system: ['ubuntu-latest'] - php: ['8.4'] - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - - name: Setup PHP with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php - with: - php-version: ${{ matrix.php }} - coverage: xdebug - tools: none - - - name: Clone addon repository - run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon - - - name: Install Composer dependencies - uses: "ramsey/composer-install@v2" - - - name: Run PHPStan - run: composer run phpstan \ No newline at end of file