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
2 changes: 2 additions & 0 deletions .github/workflows/docker-role-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: docker role validation

on:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
# Adapted from LibreCodeCoop/.github workflow-templates/lint-php.yml.
name: Lint PHP syntax

on:
pull_request:
push:
branches: [main]

concurrency:
group: lint-php-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Use Nextcloud 35 minimum PHP version
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0
with:
php-version: '8.3'
coverage: none
- name: Lint all tracked PHP files
run: git ls-files -z '*.php' | xargs -0 -r -n1 php -l
23 changes: 17 additions & 6 deletions .github/workflows/nextcloud-mailcow-provision-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Nextcloud Mailcow reusable role

on:
Expand All @@ -16,13 +18,22 @@ permissions:

jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 15
runs-on: ubuntu-24.04
timeout-minutes: 18
strategy:
fail-fast: false
matrix:
php: ['8.3', '8.4', '8.5']
steps:
- uses: actions/checkout@v4
- name: Install role test dependencies
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Ansible Core
run: |
python3 -m pip install --user 'Jinja2>=3.1,<4' 'PyYAML>=6,<7' 'ansible-core>=2.18,<2.22'
python3 -m pip install --user 'ansible-core>=2.18,<2.22'
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Offline PHP tests, Jinja rendering, and Ansible syntax
- name: Offline PHP tests, Ansible template rendering, and syntax
env:
PHP_TEST_VERSION: ${{ matrix.php }}
run: bash roles/nextcloud-mailcow-provision/tests/check.sh
2 changes: 2 additions & 0 deletions .github/workflows/nginx-proxy-role-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Nginx Proxy role validation

on:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/onlyoffice-role-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: onlyoffice role validation

on:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
# Adapted from LibreCodeCoop/.github workflow templates for a non-Nextcloud application.
name: PHP coding style

on:
pull_request:
push:
branches: [main]

concurrency:
group: phpcs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
phpcs:
runs-on: ubuntu-24.04
timeout-minutes: 12
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0
with:
php-version: '8.4'
tools: composer:v2
coverage: none
- name: Install Composer bin plugin
run: composer install --no-interaction --prefer-dist --no-progress
- name: Install isolated phpcs dependencies
run: composer bin phpcs install --no-interaction --prefer-dist --no-progress
- name: Run phpcs
run: composer phpcs
38 changes: 38 additions & 0 deletions .github/workflows/phpmd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
# Adapted from LibreCodeCoop/.github workflow templates for a non-Nextcloud application.
name: PHP cyclomatic complexity

on:
pull_request:
push:
branches: [main]

concurrency:
group: phpmd-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
phpmd:
runs-on: ubuntu-24.04
timeout-minutes: 12
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0
with:
php-version: '8.4'
tools: composer:v2
coverage: none
- name: Install Composer bin plugin
run: composer install --no-interaction --prefer-dist --no-progress
- name: Install isolated phpmd dependencies
run: composer bin phpmd install --no-interaction --prefer-dist --no-progress
- name: Run phpmd
run: composer phpmd
38 changes: 38 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
# Adapted from LibreCodeCoop/.github workflow templates for a non-Nextcloud application.
name: PHPStan static analysis

on:
pull_request:
push:
branches: [main]

concurrency:
group: phpstan-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
phpstan:
runs-on: ubuntu-24.04
timeout-minutes: 12
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0
with:
php-version: '8.4'
tools: composer:v2
coverage: none
- name: Install Composer bin plugin
run: composer install --no-interaction --prefer-dist --no-progress
- name: Install isolated phpstan dependencies
run: composer bin phpstan install --no-interaction --prefer-dist --no-progress
- name: Run phpstan
run: composer phpstan
38 changes: 38 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
# Adapted from LibreCodeCoop/.github workflow templates for a non-Nextcloud application.
name: PHPUnit regression tests

on:
pull_request:
push:
branches: [main]

concurrency:
group: phpunit-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
phpunit:
runs-on: ubuntu-24.04
timeout-minutes: 12
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0
with:
php-version: '8.3'
tools: composer:v2
coverage: none
- name: Install Composer bin plugin
run: composer install --no-interaction --prefer-dist --no-progress
- name: Install isolated phpunit dependencies
run: composer bin phpunit install --no-interaction --prefer-dist --no-progress
- name: Run phpunit
run: composer test:unit && composer test:integration
38 changes: 38 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
# Adapted from LibreCodeCoop/.github workflow templates for a non-Nextcloud application.
name: Psalm static analysis

on:
pull_request:
push:
branches: [main]

concurrency:
group: psalm-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
psalm:
runs-on: ubuntu-24.04
timeout-minutes: 12
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0
with:
php-version: '8.4'
tools: composer:v2
coverage: none
- name: Install Composer bin plugin
run: composer install --no-interaction --prefer-dist --no-progress
- name: Install isolated psalm dependencies
run: composer bin psalm install --no-interaction --prefer-dist --no-progress
- name: Run psalm
run: composer psalm
27 changes: 27 additions & 0 deletions .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow is provided via the organization template repository
#
# https://github.com/LibreCodeCoop/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
#
# SPDX-License-Identifier: CC0-1.0

name: REUSE Compliance Check

on: [pull_request]

permissions:
contents: read

jobs:
reuse-compliance-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: REUSE Compliance Check
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0
23 changes: 16 additions & 7 deletions .github/workflows/static-credential-guard.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# SPDX-FileCopyrightText: 2026 LibreCode Coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Static credential guard

on:
pull_request:
push:
branches:
- main
branches: [main]

permissions:
contents: read
Expand All @@ -13,12 +14,20 @@ jobs:
prevent-static-credentials:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Checkout complete history
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Unit tests
run: python3 -m unittest discover -s tests/security -p 'test_*.py' -v
- name: Check tracked files and new commit blobs without displaying values
persist-credentials: false
- name: Set up PHP
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2.40.0
with:
php-version: '8.3'
tools: composer:v2
coverage: none
- name: Install autoloader
run: composer install --no-interaction --prefer-dist --no-progress
- name: Check tracked files and intermediate commits without printing secret values
env:
SECRET_GUARD_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: python3 scripts/check_secret_literals.py
run: php scripts/check_secret_literals.php
Loading
Loading