diff --git a/.woodpecker/.code_standards_check.yml b/.woodpecker/.code_standards_check.yml index 30938f15fe..e6b02c3d7d 100644 --- a/.woodpecker/.code_standards_check.yml +++ b/.woodpecker/.code_standards_check.yml @@ -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} diff --git a/.woodpecker/.continuous-deployment.yml b/.woodpecker/.continuous-deployment.yml index eff4ae0cff..f661104acf 100644 --- a/.woodpecker/.continuous-deployment.yml +++ b/.woodpecker/.continuous-deployment.yml @@ -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 diff --git a/.woodpecker/.database_checks.yml b/.woodpecker/.database_checks.yml index 6bde5b281e..c7b5ce533d 100644 --- a/.woodpecker/.database_checks.yml +++ b/.woodpecker/.database_checks.yml @@ -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: diff --git a/.woodpecker/.license_check.yml b/.woodpecker/.license_check.yml index 1417fb9a9c..86174e51fd 100644 --- a/.woodpecker/.license_check.yml +++ b/.woodpecker/.license_check.yml @@ -2,6 +2,11 @@ # # SPDX-License-Identifier: CC0-1.0 +when: + branch: + exclude: [ stable ] + event: [ pull_request, push ] + steps: check: image: fsfe/reuse:latest diff --git a/.woodpecker/.messages.po_check.yml b/.woodpecker/.messages.po_check.yml index 8df12b93ce..2f9ae94044 100644 --- a/.woodpecker/.messages.po_check.yml +++ b/.woodpecker/.messages.po_check.yml @@ -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 ] diff --git a/.woodpecker/.phpunit.yml b/.woodpecker/.phpunit.yml index 58b5723cc6..5bea36122b 100644 --- a/.woodpecker/.phpunit.yml +++ b/.woodpecker/.phpunit.yml @@ -19,6 +19,11 @@ matrix: labels: location: opensocial +when: + branch: + exclude: [ stable ] + event: [ pull_request, push ] + steps: php-lint: image: php:${PHP_MAJOR_VERSION} diff --git a/.woodpecker/.releaser.yml b/.woodpecker/.releaser.yml index 0c7caac009..8a720a2607 100644 --- a/.woodpecker/.releaser.yml +++ b/.woodpecker/.releaser.yml @@ -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