Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/scripts/generate-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function parsePHPVersion() {
}

# Default values
defaultPhpVersion="8.2"
defaultPhpVersion="8.3"
if [ -n "$DEFAULT_PHP_VERSION" ]; then
checkPHPVersionFormat "$DEFAULT_PHP_VERSION"
defaultPhpVersion=$(parsePHPVersion "$DEFAULT_PHP_VERSION")
Expand Down Expand Up @@ -155,8 +155,6 @@ for ncVersion in $nextcloudVersions; do
phpVersion="8.1"
elif [ "$ncVersion" = "stable30" ]; then
phpVersion="8.2"
elif [ "$ncVersion" = "master" ]; then
phpVersion="8.3"
else
phpVersion="$defaultPhpVersion"
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/scripts/notify-nc-and-apps-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@ is_latest_release_tag() {
if [[ $version_count -gt 1 ]]; then
log_info "Multiple new releases of \"$APP_NAME\" found: $version_count versions."
# Join multiple releases into a single line, separated by comma + space
message='<b>🔔 Alert! Multiple new releases of \"'$APP_NAME'\":<b> '
message="<b>🔔 Alert! Multiple new releases of '$APP_NAME':<b> "
mapfile -t tags <<< "$nextcloud_latest_release_tag" # Convert newlines into array elements

for tag in "${tags[@]}"; do
message+="<a href=\"https://github.com/$REPO_OWNER/$REPO_NAME/releases/tag/$tag\">$tag</a>, "
message+="<a href='https://github.com/$REPO_OWNER/$REPO_NAME/releases/tag/$tag'>$tag</a>, "
done

message=${message%, } # Remove trailing comma and space
else
message='<b>🔔 Alert! New release of \"'$APP_NAME'\":<b> <a href=\"https://github.com/$REPO_OWNER/$REPO_NAME/releases/tag/$nextcloud_latest_release_tag\">'$nextcloud_latest_release_tag'</a>'
message="<b>🔔 Alert! New release of '$APP_NAME':<b> <a href='https://github.com/$REPO_OWNER/$REPO_NAME/releases/tag/$nextcloud_latest_release_tag'>$nextcloud_latest_release_tag</a>"
fi

log_info "Found new release tag(s): $nextcloud_latest_release_tag"
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/notify-to-element.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ send_message_to_room_response=$(curl -s -XPOST "$ELEMENT_CHAT_URL/_matrix/client
"msgtype": "m.text",
"body": "",
"format": "org.matrix.custom.html",
"formatted_body": "<a href=\"https://github.com/$REPO_OWNER/$REPO_NAME/actions/runs/$RUN_ID\">NC-Nightly-'$BRANCH_NAME'</a><br></br><b><i>Status: '$workflow_status'</i></b>"
"formatted_body": "<a href=\"https://github.com/'$REPO_OWNER'/'$REPO_NAME'/actions/runs/'$RUN_ID'\">NC-Nightly-'$BRANCH_NAME'</a><br></br><b><i>Status: '$workflow_status'</i></b>"
}
'
)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
uses: ./.github/workflows/shared_workflow.yml
secrets: inherit
with:
branch: master
branch: release/2.10
101 changes: 57 additions & 44 deletions .github/workflows/shared_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
make jsunit

- name: JS Code Coverage Summary Report
if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable32' && matrix.phpVersion == '8.2' }}
if: ${{ github.event_name == 'pull_request' }}
uses: romeovs/lcov-reporter-action@v0.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -65,11 +65,11 @@ jobs:
title: "JS Code Coverage"

- name: JS coverage check
if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable32' && matrix.phpVersion == '8.2' }}
if: ${{ github.event_name == 'pull_request' }}
uses: VeryGoodOpenSource/very_good_coverage@v2
with:
min_coverage: '59'
path: './server/apps/integration_openproject/coverage/jest/lcov.info'
path: './coverage/jest/lcov.info'

create-matrix:
runs-on: ubuntu-22.04
Expand All @@ -84,7 +84,7 @@ jobs:
env:
NEXTCLOUD_VERSIONS: ${{ inputs.nextcloud_versions }}
PHP_VERSIONS: ${{ inputs.php_versions }}
DEFAULT_PHP_VERSION: "8.2"
DEFAULT_PHP_VERSION: "8.3"
DEFAULT_DATABASE: "mysql"
EXTRA_DATABASES: "pgsql"
run: |
Expand Down Expand Up @@ -112,11 +112,9 @@ jobs:
SQL: ${{ matrix.database }}
SERVER_BRANCH: ${{ matrix.nextcloudVersion }}
NEXTCLOUD_AUTOINSTALL: "Yes"
NEXTCLOUD_AUTOINSTALL_APPS: "viewer activity groupfolders integration_openproject"
NEXTCLOUD_TRUSTED_DOMAINS: nextcloud
VIRTUAL_HOST: "nextcloud"
WITH_REDIS: "YES"
NEXTCLOUD_AUTOINSTALL_APPS_WAIT_TIME: 120
ports:
- 80:80
options: --name=nextcloud
Expand Down Expand Up @@ -148,44 +146,43 @@ jobs:
path: integration_openproject
ref: ${{ inputs.branch }}

- name: Checkout activity app
- name: Checkout server (for phpunit and psalm)
uses: actions/checkout@v6
with:
submodules: true
repository: nextcloud/server
path: integration_openproject/server
ref: ${{ matrix.nextcloudVersion }}

# activity app cannot be installed using occ command
- name: Checkout (activity)
uses: actions/checkout@v6
with:
repository: nextcloud/activity
path: activity
ref: ${{ matrix.nextcloudVersion }}
path: activity

- name: Checkout groupfolders app
- name: Checkout (groupfolders)
uses: actions/checkout@v6
if: ${{ matrix.nextcloudVersion == 'master' }}
with:
repository: nextcloud/groupfolders
path: groupfolders
ref: ${{ matrix.nextcloudVersion }}

- name: Checkout user_oidc app
- name: Checkout (user_oidc)
uses: actions/checkout@v6
if: ${{ matrix.nextcloudVersion == 'master' }}
with:
repository: nextcloud/user_oidc
ref: v7.2.0
fetch-tags: true
path: user_oidc

- name: Checkout oidc app
- name: Checkout (oidc)
uses: actions/checkout@v6
if: ${{ matrix.nextcloudVersion == 'master' }}
with:
repository: h2CK/oidc
ref: 1.6.0
fetch-tags: true
path: oidc

- name: Checkout server (for phpunit and psalm)
uses: actions/checkout@v6
with:
submodules: true
repository: nextcloud/server
path: integration_openproject/server
ref: ${{ matrix.nextcloudVersion }}

- name: Setup PHP ${{ format('{0}.{1}', matrix.phpVersionMajor,matrix.phpVersionMinor) }}
uses: shivammathur/setup-php@v2
with:
Expand All @@ -205,31 +202,39 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('./composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Setup server and apps
run: |
# integration_openproject app
composer install --no-progress --prefer-dist --optimize-autoloader
# user_oidc app
composer install --no-interaction --prefer-dist --optimize-autoloader --working-dir=../user_oidc
cd server && ./occ maintenance:install --admin-pass=admin
- name: Install PHP dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Prepare Nextcloud server (for phpunit and psalm)
run: server/occ maintenance:install --admin-pass=admin

- name: PHP code analysis and linting
run: |
make psalm
make phpcs || ( echo 'Please run `make phpcs-fix` to format your code' && exit 1 )

- name: Enable apps
- name: Copy dependent apps
run: |
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --working-dir=../activity
cp -r ../activity server/apps
if [ "${{matrix.nextcloudVersion}}" == "master" ]; then
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --working-dir=../user_oidc
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --working-dir=../oidc
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --working-dir=../groupfolders
cp -r ../oidc ../user_oidc ../groupfolders server/apps
fi

- name: Enable apps (for phpunit)
run: |
mkdir -p server/apps/integration_openproject
cp -r `ls -A | grep -v 'server'` server/apps/integration_openproject/
cp -r ../groupfolders ../activity server/apps
cd server
./occ a:e groupfolders integration_openproject activity
if [ "${{matrix.nextcloudVersion}}" != "stable27" ]; then
cp -r ../../user_oidc ../../oidc apps
./occ a:e user_oidc
# enable app even if it is not compatible with the current server version
./occ a:e -f oidc
if [ "${{matrix.nextcloudVersion}}" == "master" ]; then
# enable app even if it is not compatible with the master branch
./occ a:e -f activity oidc user_oidc groupfolders integration_openproject
else
./occ a:e activity oidc user_oidc groupfolders integration_openproject
cp -r apps/oidc apps/user_oidc apps/groupfolders ${{ github.workspace }}
fi

- name: PHP Unit Tests
Expand Down Expand Up @@ -283,12 +288,16 @@ jobs:
run: |
# Disable share rate limit protection
docker exec nextcloud /bin/bash -c 'occ config:system:set ratelimit.protection.enabled --value false --type bool'
# Enable apps
if [ "${{matrix.nextcloudVersion}}" == "master" ]; then
# enable app even if it is not compatible with the master branch
docker exec nextcloud /bin/bash -c 'occ a:e -f activity oidc user_oidc groupfolders integration_openproject'
else
docker exec nextcloud /bin/bash -c 'occ a:e activity oidc user_oidc groupfolders integration_openproject'
fi

- name: API Tests
env:
NEXTCLOUD_BASE_URL: http://localhost
- name: Wait for Nextcloud server to be ready
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
if ! timeout 5m bash -c '
until curl -s -f http://localhost/status.php | grep '"'"'"installed":true'"'"'; do
echo "[INFO] Waiting for server to be ready..."
Expand All @@ -298,7 +307,11 @@ jobs:
echo "[ERROR] Server not ready within 5 minutes."
exit 1
fi
make api-test

- name: API Tests
env:
NEXTCLOUD_BASE_URL: http://localhost
run: make api-test

notify-nightly-report:
needs:
Expand Down
Loading