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
# 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:
restore_cache:
image: meltwater/drone-cache:dev
@ -31,12 +37,19 @@ steps:
volumes:
- /tmp/drone-cache:/tmp/cache
check:
image: friendicaci/php-cs
image: php:8.3
commands:
- apt-get update -q
- DEBIAN_FRONTEND=noninteractive apt-get install -q -y git
- if [ ! -z "$${CI_COMMIT_PULL_REQUEST}" ]; then
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
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
- /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
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
steps:
@ -23,10 +29,6 @@ steps:
- git checkout $CI_COMMIT_BRANCH
- git fetch origin $CI_COMMIT_REF
- git merge $CI_COMMIT_SHA
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
restore_cache:
image: meltwater/drone-cache:dev
settings:
@ -38,10 +40,6 @@ steps:
- '.composer'
volumes:
- /tmp/drone-cache:/tmp/cache
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
composer_install:
image: friendicaci/php8.2:php8.2.16
commands:
@ -50,10 +48,6 @@ steps:
- composer install --no-dev --optimize-autoloader
volumes:
- /etc/hosts:/etc/hosts
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
create_artifacts:
image: debian
commands:
@ -74,10 +68,6 @@ steps:
- ls -lh
- cat "$ARTIFACT.sum256"
- sha256sum "$ARTIFACT"
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
sign_artifacts:
image: plugins/gpgsign
settings:
@ -90,17 +80,9 @@ steps:
exclude:
- build/*.sum256
detach_sign: true
when:
repo: friendica/friendica
branch: [ develop, '*-rc' ]
event: push
publish_artifacts:
image: alpine
commands:
- cp -fr build/* /tmp/friendica_files/
volumes:
- 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
when:
- branch:
exclude: [ stable ]
branch:
exclude: [ stable ]
event: [ pull_request, push ]
# This forces CI executions at the "opensocial" labeled location (because of much more power...)
labels:

View file

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

View file

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

View file

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

View file

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