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
53 changes: 25 additions & 28 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
{
"name": "PHP",
"image": "mcr.microsoft.com/devcontainers/php:1-8.3-bullseye",
"forwardPorts": [
80
],
"containerEnv": {
"XDEBUG_MODE": "debug,develop"
},
"customizations": {
"vscode": {
"extensions": [
"CharlieGerard.pride-vscode-themes",
"junstyle.php-cs-fixer",
"stylelint.vscode-stylelint",
"jetmartin.bats",
"recca0120.vscode-phpunit"
]
}
},
"postStartCommand": ".devcontainer/postCreateCommands.sh",
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/edouard-lopez/devcontainer-features/bats:0": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/wxw-matt/devcontainer-features/apt:latest": {
"packages": "bash-completion vim iputils-ping telnet"
}
"name": "PHP",
"image": "mcr.microsoft.com/devcontainers/php:1-8.4-bullseye",
"forwardPorts": [
8080,
8081
],
"customizations": {
"vscode": {
"extensions": [
"junstyle.php-cs-fixer",
"stylelint.vscode-stylelint",
"jetmartin.bats",
"recca0120.vscode-phpunit"
]
}
},
"postStartCommand": ".devcontainer/postCreateCommands.sh",
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/szkiba/devcontainer-features/bats:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/wxw-matt/devcontainer-features/apt:latest": {
"packages": "bash-completion vim iputils-ping telnet"
}
}
}
28 changes: 15 additions & 13 deletions .devcontainer/postCreateCommands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,33 @@
#
# SPDX-License-Identifier: AGPL-3.0-or-later

for d in "/usr/local/etc/php/conf.d" "${PHP_INI_DIR}/conf.d"; do
if [ -n "$d" ] && [ -d "$d" ]; then
echo "Setting PHP CLI memory_limit=-1 in $d/99-memory-limit.ini"
echo "memory_limit = -1" | sudo tee "$d/99-memory-limit.ini" >/dev/null || true
fi
done

export COMPOSER_MEMORY_LIMIT=-1

bash -i -c 'nvm install 20'
bash -i -c 'nvm use 20'

echo "setup php-scoper"
composer global require humbug/php-scoper
$(composer config home)/vendor/bin/php-scoper completion bash >> $HOME.bash_completion
echo "export PATH=$(composer config home)/vendor/bin/:\$PATH" >> $HOME/.bashrc
export PATH=$(composer config home)/vendor/bin/:$PATH

sudo cp memory.ini /usr/local/etc/php/conf.d/memory.ini
echo "export PATH=$(composer config home)/vendor/bin/:\$PATH" >> "$HOME"/.bashrc
COMPOSER_HOME=$(composer config home)
export PATH=$COMPOSER_HOME/vendor/bin/:$PATH

if [[ "$IS_CI" == "true" ]]; then
if [[ "$IS_CI" == 1 ]]; then
echo "Skipping bash completion setup in CI environment"
exit 0
fi

sudo bash -c "docker completion bash > /usr/share/bash-completion/completions/docker"
sudo bash -c "composer completion bash > /usr/share/bash-completion/completions/composer"
sudo bash -c "npm completion > /usr/share/bash-completion/completions/npm"
sudo cp xdebug.local.ini /usr/local/etc/php/conf.d/xdebug.ini

echo ". /usr/share/bash-completion/bash_completion" >> /home/vscode/.bashrc

NEXTCLOUD_VERSION=$(grep -oP -m 1 "[0-9]+\.[0-9]+\.[0-9]+" install.sh)

mkdir -p ~/.ssh/

./get-nc-server.sh "$NEXTCLOUD_VERSION"
./install.sh
./scripts/run-app.sh
2 changes: 1 addition & 1 deletion .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1

- name: Set up php${{ steps.versions.outputs.php-min }}
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
with:
php-version: ${{ steps.versions.outputs.php-min }}
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
persist-credentials: false

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
with:
php-version: ${{ matrix.php-versions }}
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/psalm-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
persist-credentials: false

- name: Set up php${{ matrix.php-min }}
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
with:
php-version: ${{ matrix.php-min }}
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
Expand All @@ -62,7 +62,7 @@ jobs:
- name: Install dependencies
run: |
composer remove nextcloud/ocp --dev --no-scripts
./get-nc-server.sh
./scripts/get-nc-server.sh
composer i

- name: Check for vulnerable PHP dependencies
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SPDX-FileCopyrightText: 2025 Lennart Dohmann <[email protected]>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

name: Release App

on:
push:
tags: ["*"]

jobs:
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@master
with:
name: build-dir
path: build/

- name: write version to output
id: write-version-to-output
run: |
RELEASE_VERSION=${GITHUB_REF#refs/tags/}
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT

- name: Github Release
uses: softprops/action-gh-release@v2
with:
files: build/artifacts/*

- name: Attach tarball to github release
uses: svenstaro/upload-release-action@v2
id: attach_to_release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./build/artifacts/gdatavaas.tar.gz
asset_name: gdatavaas.tar.gz
tag: ${{ github.ref }}
overwrite: true

- name: Upload app to Nextcloud appstore
uses: nextcloud-releases/nextcloud-appstore-push-action@v1
with:
app_name: gdatavaas
appstore_token: ${{ secrets.VAAS_APPSTORE_TOKEN }}
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
app_private_key: ${{ secrets.VAAS_NEXTCLOUD_KEY }}
74 changes: 5 additions & 69 deletions .github/workflows/release-app.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-or-later

name: Build and Test
name: Tests

defaults:
run:
Expand All @@ -15,21 +15,12 @@ on:
workflow_dispatch:

jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
nextcloud_versions: ${{ steps.get-matrix.outputs.nextcloud_versions }}
steps:
- uses: actions/checkout@v4
- id: get-matrix
run: echo "nextcloud_versions=$(./get-matrix.sh)" | tee -a "$GITHUB_OUTPUT"

build-devcontainer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -41,19 +32,15 @@ jobs:
cacheFrom: ghcr.io/gdatasoftwareag/nextcloud/builder
push: always

test:
tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/gdatasoftwareag/nextcloud/builder:latest
env:
IS_CI: true
IS_CI: 1
options: --name nextcloud-antivirus-build-container
needs:
- define-matrix
- build-devcontainer
strategy:
matrix:
nextcloud_version: ${{fromJson(needs.define-matrix.outputs.nextcloud_versions)}}
steps:
- uses: actions/checkout@v4

Expand All @@ -64,7 +51,6 @@ jobs:
- name: add composer bin to path
run: |
echo $(composer config home --global)/vendor/bin >> $GITHUB_PATH
echo "/home/vscode/bin/" >> $GITHUB_PATH

- name: replace version in ./appinfo/info.xml
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -90,7 +76,7 @@ jobs:
env:
CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }}
run: ./install.sh ${{ matrix.nextcloud_version }} 1
run: ./scripts/run-app.sh 31.0.8 1

- name: add builder into nextcloud network
run: |
Expand All @@ -108,61 +94,11 @@ jobs:
echo "bats_run=fail" | tee -a "$GITHUB_OUTPUT";
fi

- uses: actions/upload-artifact@master
with:
overwrite: true
name: core-dump
path: coredumps/*

- name: fail if bats tests did fail
if: steps.bats-tests.outputs.bats_run == 'fail'
run: exit 1

- uses: actions/upload-artifact@master
with:
overwrite: true
name: build-dir
path: build/

release:
needs:
- test
- define-matrix
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@master
with:
name: build-dir
path: build/

- name: write version to output
id: write-version-to-output
run: |
RELEASE_VERSION=${GITHUB_REF#refs/tags/}
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT

- name: Github Release
uses: softprops/action-gh-release@v2
with:
files: build/artifacts/*

- name: Attach tarball to github release
uses: svenstaro/upload-release-action@v2
id: attach_to_release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./build/artifacts/gdatavaas.tar.gz
asset_name: gdatavaas.tar.gz
tag: ${{ github.ref }}
overwrite: true

- name: Upload app to Nextcloud appstore
uses: nextcloud-releases/nextcloud-appstore-push-action@v1
with:
app_name: gdatavaas
appstore_token: ${{ secrets.VAAS_APPSTORE_TOKEN }}
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
app_private_key: ${{ secrets.VAAS_NEXTCLOUD_KEY }}
66 changes: 0 additions & 66 deletions .vscode/launch.json

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/launch.json.license

This file was deleted.

Loading