#
# 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
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
+ CHANGED_FILES="$(git diff --name-only --diff-filter=ACMRTUXB ${CI_COMMIT_SHA})";
+ fi
+ - 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
- export CHANGED_FILES="$(git diff --name-status ${CI_COMMIT_SHA} | grep ^A | cut -f2)";
+ EXTRA_ARGS='';
fi
- - /check-php-cs.sh
+ - ./bin/dev/php-cs-fixer/vendor/bin/php-cs-fixer check --config=.php-cs-fixer.dist.php -v --diff --using-cache=no $${EXTRA_ARGS}
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:
- 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:
- '.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:
- 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:
- ls -lh
- cat "$ARTIFACT.sum256"
- sha256sum "$ARTIFACT"
- when:
- repo: friendica/friendica
- branch: [ develop, '*-rc' ]
- event: push
sign_artifacts:
image: plugins/gpgsign
settings:
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
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:
#
# SPDX-License-Identifier: CC0-1.0
+when:
+ branch:
+ exclude: [ stable ]
+ event: [ pull_request, push ]
+
steps:
check:
image: fsfe/reuse:latest
#
# SPDX-License-Identifier: CC0-1.0
+when:
+ branch:
+ exclude: [ stable ]
+ event: [ pull_request, push ]
+
steps:
build_xgettext:
image: friendicaci/transifex
image: friendicaci/transifex
commands:
- /check-messages.sh
-
-when:
- - branch:
- exclude: [ stable ]
labels:
location: opensocial
+when:
+ branch:
+ exclude: [ stable ]
+ event: [ pull_request, push ]
+
steps:
php-lint:
image: php:${PHP_MAJOR_VERSION}
skip_clone: true
+when:
+ repo: friendica/friendica
+ branch: stable
+ event: tag
+
steps:
clone:
image: alpine/git
- 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:
- '.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:
- ls -lh
- cat "$ARTIFACT.sum256"
- sha256sum "$ARTIFACT"
- when:
- repo: friendica/friendica
- branch: stable
- event: tag
sign_artifacts:
image: plugins/gpgsign
settings:
- cp -fr build/* /tmp/friendica_files/
volumes:
- files:/tmp/friendica_files
- when:
- repo: friendica/friendica
- branch: stable
- event: tag