Merge pull request #14643 from nupplaphil/ci/warnings

[CI] Fixup warnings & use php-cs directly
This commit is contained in:
Hypolite Petovan 2024-12-30 11:48:46 -05:00 committed by GitHub
commit 268af9517a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 47 additions and 54 deletions

View file

@ -2,6 +2,12 @@
# #
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
# The code standard check is just triggered for PRs and pushes to non-stable branches of Friendica
when:
branch:
exclude: [ stable ]
event: [ pull_request, push ]
steps: steps:
restore_cache: restore_cache:
image: meltwater/drone-cache:dev image: meltwater/drone-cache:dev
@ -31,12 +37,19 @@ steps:
volumes: volumes:
- /tmp/drone-cache:/tmp/cache - /tmp/drone-cache:/tmp/cache
check: check:
image: friendicaci/php-cs image: php:8.3
commands: commands:
- apt-get update -q
- DEBIAN_FRONTEND=noninteractive apt-get install -q -y git
- if [ ! -z "$${CI_COMMIT_PULL_REQUEST}" ]; then - if [ ! -z "$${CI_COMMIT_PULL_REQUEST}" ]; then
git fetch --no-tags origin ${CI_COMMIT_TARGET_BRANCH}; git fetch --no-tags origin ${CI_COMMIT_TARGET_BRANCH};
export CHANGED_FILES="$(git diff --name-status $(git merge-base FETCH_HEAD origin/${CI_COMMIT_TARGET_BRANCH})..${CI_COMMIT_SHA} | grep ^A | cut -f2)"; CHANGED_FILES="$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base FETCH_HEAD origin/${CI_COMMIT_TARGET_BRANCH})..${CI_COMMIT_SHA})";
else else
export CHANGED_FILES="$(git diff --name-status ${CI_COMMIT_SHA} | grep ^A | cut -f2)"; CHANGED_FILES="$(git diff --name-only --diff-filter=ACMRTUXB ${CI_COMMIT_SHA})";
fi fi
- /check-php-cs.sh - if ! echo "$${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then
EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "$${CHANGED_FILES}");
else
EXTRA_ARGS='';
fi
- ./bin/dev/php-cs-fixer/vendor/bin/php-cs-fixer check --config=.php-cs-fixer.dist.php -v --diff --using-cache=no $${EXTRA_ARGS}

View file

@ -13,6 +13,12 @@ labels:
location: friendica location: friendica
type: releaser type: releaser
# CD is triggered after pushing new code to the develop or *-rc branch, excluding the stable branch
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
skip_clone: true skip_clone: true
steps: steps:
@ -23,10 +29,6 @@ steps:
- git checkout $CI_COMMIT_BRANCH - git checkout $CI_COMMIT_BRANCH
- git fetch origin $CI_COMMIT_REF - git fetch origin $CI_COMMIT_REF
- git merge $CI_COMMIT_SHA - git merge $CI_COMMIT_SHA
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
restore_cache: restore_cache:
image: meltwater/drone-cache:dev image: meltwater/drone-cache:dev
settings: settings:
@ -38,10 +40,6 @@ steps:
- '.composer' - '.composer'
volumes: volumes:
- /tmp/drone-cache:/tmp/cache - /tmp/drone-cache:/tmp/cache
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
composer_install: composer_install:
image: friendicaci/php8.2:php8.2.16 image: friendicaci/php8.2:php8.2.16
commands: commands:
@ -50,10 +48,6 @@ steps:
- composer install --no-dev --optimize-autoloader - composer install --no-dev --optimize-autoloader
volumes: volumes:
- /etc/hosts:/etc/hosts - /etc/hosts:/etc/hosts
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
create_artifacts: create_artifacts:
image: debian image: debian
commands: commands:
@ -74,10 +68,6 @@ steps:
- ls -lh - ls -lh
- cat "$ARTIFACT.sum256" - cat "$ARTIFACT.sum256"
- sha256sum "$ARTIFACT" - sha256sum "$ARTIFACT"
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
sign_artifacts: sign_artifacts:
image: plugins/gpgsign image: plugins/gpgsign
settings: settings:
@ -90,17 +80,9 @@ steps:
exclude: exclude:
- build/*.sum256 - build/*.sum256
detach_sign: true detach_sign: true
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
publish_artifacts: publish_artifacts:
image: alpine image: alpine
commands: commands:
- cp -fr build/* /tmp/friendica_files/ - cp -fr build/* /tmp/friendica_files/
volumes: volumes:
- files:/tmp/friendica_files - files:/tmp/friendica_files
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push

View file

@ -8,8 +8,9 @@ matrix:
PHP_VERSION: 8.2.16 PHP_VERSION: 8.2.16
when: when:
- branch: branch:
exclude: [ stable ] exclude: [ stable ]
event: [ pull_request, push ]
# This forces CI executions at the "opensocial" labeled location (because of much more power...) # This forces CI executions at the "opensocial" labeled location (because of much more power...)
labels: labels:

View file

@ -2,6 +2,11 @@
# #
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
when:
branch:
exclude: [ stable ]
event: [ pull_request, push ]
steps: steps:
check: check:
image: fsfe/reuse:latest image: fsfe/reuse:latest

View file

@ -2,6 +2,11 @@
# #
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
when:
branch:
exclude: [ stable ]
event: [ pull_request, push ]
steps: steps:
build_xgettext: build_xgettext:
image: friendicaci/transifex image: friendicaci/transifex
@ -11,7 +16,3 @@ steps:
image: friendicaci/transifex image: friendicaci/transifex
commands: commands:
- /check-messages.sh - /check-messages.sh
when:
- branch:
exclude: [ stable ]

View file

@ -19,6 +19,11 @@ matrix:
labels: labels:
location: opensocial location: opensocial
when:
branch:
exclude: [ stable ]
event: [ pull_request, push ]
steps: steps:
php-lint: php-lint:
image: php:${PHP_MAJOR_VERSION} image: php:${PHP_MAJOR_VERSION}

View file

@ -13,6 +13,11 @@ labels:
skip_clone: true skip_clone: true
when:
repo: friendica/friendica
branch: stable
event: tag
steps: steps:
clone: clone:
image: alpine/git image: alpine/git
@ -21,10 +26,7 @@ steps:
- git checkout $CI_COMMIT_BRANCH - git checkout $CI_COMMIT_BRANCH
- git fetch origin $CI_COMMIT_REF - git fetch origin $CI_COMMIT_REF
- git merge $CI_COMMIT_SHA - git merge $CI_COMMIT_SHA
when:
repo: friendica/friendica
branch: stable
event: tag
restore_cache: restore_cache:
image: meltwater/drone-cache:dev image: meltwater/drone-cache:dev
settings: settings:
@ -36,20 +38,12 @@ steps:
- '.composer' - '.composer'
volumes: volumes:
- /tmp/drone-cache:/tmp/cache - /tmp/drone-cache:/tmp/cache
when:
repo: friendica/friendica
branch: stable
event: tag
composer_install: composer_install:
image: friendicaci/php8.2:php8.2.16 image: friendicaci/php8.2:php8.2.16
commands: commands:
- export COMPOSER_HOME=.composer - export COMPOSER_HOME=.composer
- composer validate - composer validate
- composer install --no-dev --optimize-autoloader - composer install --no-dev --optimize-autoloader
when:
repo: friendica/friendica
branch: stable
event: tag
volumes: volumes:
- /etc/hosts:/etc/hosts - /etc/hosts:/etc/hosts
create_artifacts: create_artifacts:
@ -72,10 +66,6 @@ steps:
- ls -lh - ls -lh
- cat "$ARTIFACT.sum256" - cat "$ARTIFACT.sum256"
- sha256sum "$ARTIFACT" - sha256sum "$ARTIFACT"
when:
repo: friendica/friendica
branch: stable
event: tag
sign_artifacts: sign_artifacts:
image: plugins/gpgsign image: plugins/gpgsign
settings: settings:
@ -98,7 +88,3 @@ steps:
- cp -fr build/* /tmp/friendica_files/ - cp -fr build/* /tmp/friendica_files/
volumes: volumes:
- files:/tmp/friendica_files - files:/tmp/friendica_files
when:
repo: friendica/friendica
branch: stable
event: tag