Skip to content
Open
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
# Keep GitHub Actions up-to-date
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups: #all in one PR
github-actions-all:
patterns:
- "*"
109 changes: 45 additions & 64 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches:
- master
- develop
- 'feature/*'
- 'hotfix/*'
- 'release/*'
tags:
- '*'
pull_request:
Expand All @@ -19,34 +16,56 @@ concurrency:
cancel-in-progress: true

jobs:
setup-phpunit-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.gen.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- id: gen
uses: galette/.github/actions/matrix-generator@main
with:
all-jobs: ${{ github.event_name != 'pull_request' && github.repository == 'galette/galette-objectslend' && (github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags')) }}

setup-lint-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.gen.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- id: gen
uses: galette/.github/actions/matrix-generator@main
with:
target: lint
all-jobs: ${{ github.event_name != 'pull_request' && github.repository == 'galette/galette-objectslend' && (github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags')) }}

lint:
runs-on: ubuntu-latest
name: "Lint on PHP ${{ matrix.php-versions }}"
needs: setup-lint-matrix
name: "Lint on PHP ${{ matrix.php-version }}"

strategy:
matrix:
php-versions: [ '8.2', '8.5' ]
coverage: [none]
matrix: ${{ fromJSON(needs.setup-lint-matrix.outputs.matrix) }}
fail-fast: false

steps:
- name: PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: ${{ matrix.php-version }}
tools: composer
coverage: ${{ matrix.coverage }}

- name: Checkout Galette core
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: galette/galette
path: galette-core
fetch-depth: 1
ref: develop

- name: Checkout plugin
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
path: galette-core/galette/plugins/plugin-objectslend

Expand All @@ -56,7 +75,7 @@ jobs:
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -73,7 +92,7 @@ jobs:
../../vendor/bin/phpcs lib/ ./*.php

- name: CS Fixer
if: matrix.php-versions == '8.1'
if: matrix.php-is-min
run: |
cd galette-core/galette/plugins/plugin-objectslend
../../vendor/bin/php-cs-fixer check --show-progress=dots --verbose --diff
Expand All @@ -90,35 +109,21 @@ jobs:

- name: Headers checks
run: |
cd galette-core/galette/plugins/plugin-objectslend
../../vendor/bin/docheader --docheader=../../../.docheader check lib ./*.php
cd galette-core
./bin/console galette:headers:check \
--project-name="Galette Objects Lend plugin" \
--start-year="2013" \
--directory="galette/plugins/plugin-objectslend"

unit-tests:
runs-on: ubuntu-latest
needs: setup-phpunit-matrix

strategy:
matrix:
include:
#always tests higher stable php version with lower db version
#enable coverage on higher stable php version with higher postrgesql version
#lower php version
- { php-version: "8.2", db-image: "mysql:5.7", coverage: none, always: false }
- { php-version: "8.2", db-image: "mysql:8.1", coverage: none, always: false }
- { php-version: "8.2", db-image: "mariadb:10.4", coverage: none, always: false }
- { php-version: "8.2", db-image: "mariadb:11", coverage: none, always: false }
- { php-version: "8.2", db-image: "postgres:11", coverage: none, always: false }
- { php-version: "8.2", db-image: "postgres:16", coverage: none, always: false }
#higher stable php version
- { php-version: "8.5", db-image: "mysql:5.7", coverage: none, always: true }
- { php-version: "8.5", db-image: "mysql:8.1", coverage: none, always: false }
- { php-version: "8.5", db-image: "mariadb:10.4", coverage: none, always: true }
- { php-version: "8.5", db-image: "mariadb:11", coverage: none, always: false }
- { php-version: "8.5", db-image: "postgres:11", coverage: none, always: true }
- { php-version: "8.5", db-image: "postgres:16", coverage: none, always: true }
matrix: ${{ fromJSON(needs.setup-phpunit-matrix.outputs.matrix) }}
fail-fast: false

env:
skip: ${{ matrix.always == false && (github.event_name == 'pull_request' || github.repository != 'galette/plugin-objectslend' || !(github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags'))) }}
DB: ${{ matrix.db-image }}

services:
Expand Down Expand Up @@ -150,55 +155,32 @@ jobs:

steps:
- name: PHP
if: env.skip != 'true'
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: ${{ matrix.php-version }}
tools: composer, pecl
coverage: ${{ matrix.coverage }}
extensions: apcu
ini-values: apc.enable_cli=1

- name: "Show versions"
if: env.skip != 'true'
run: |
php --version
composer --version
echo "node $(node --version)"
echo "npm $(npm --version)"
docker exec ${{ job.services.db.id }} bash -c "if [[ -n \$(command -v psql) ]]; then psql --version; else if [[ -n \$(command -v mysql) ]]; then mysql --version; else mariadb --version; fi fi"

- name: Checkout Galette core
if: env.skip != 'true'
uses: actions/checkout@v4
- name: Build Galette
uses: galette/.github/actions/build-galette@main
with:
repository: galette/galette
path: galette-core
fetch-depth: 1
ref: develop
php-version: ${{ matrix.php-version }}

- name: Checkout plugin
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
path: galette-core/galette/plugins/plugin-objectslend

- name: "Restore dependencies cache"
if: env.skip != 'true'
uses: actions/cache@v4
with:
path: |
~/.composer/cache/
~/.npm/_cacache/
key: "${{ runner.os }}-galette-${{ matrix.php-version }}-${{ hashFiles('galette/composer.lock', 'package-lock.json') }}"
restore-keys: |
${{ runner.os }}-galette-${{ matrix.php-version }}-

- name: Install dependencies
if: env.skip != 'true'
run: |
cd galette-core
bin/install_deps

- name: Init for PostgreSQL
env:
POSTGRES_HOST: localhost
Expand All @@ -207,18 +189,17 @@ jobs:
cd galette-core
bin/console galette:install -v --dbtype=pgsql --dbhost=localhost --dbname=galette_tests --dbuser=galette_tests --dbpass=g@l3tte --admin=admin --password=admin --no-interaction -w
bin/console galette:plugins:install-db --all
if: env.skip != 'true' && startsWith(matrix.db-image, 'postgres')
if: startsWith(matrix.db-image, 'postgres')

- name: Init for MariaDB
run: |
cd galette-core
mysql -e 'create database IF NOT EXISTS galette_tests;' -u galette_tests --password=g@l3tte -h 127.0.0.1 -P 3306
bin/console galette:install -v --dbtype=mysql --dbhost=127.0.0.1 --dbname=galette_tests --dbuser=galette_tests --dbpass=g@l3tte --admin=admin --password=admin --no-interaction -w
bin/console galette:plugins:install-db --all
if: env.skip != 'true' && (startsWith(matrix.db-image, 'mysql') || startsWith(matrix.db-image, 'mariadb'))
if: startsWith(matrix.db-image, 'mysql') || startsWith(matrix.db-image, 'mariadb')

- name: Unit tests
if: env.skip != 'true'
run: |
cd galette-core/galette/plugins/plugin-objectslend
../../vendor/bin/phpunit --test-suffix=.php --bootstrap tests/TestsBootstrap.php --no-coverage --process-isolation tests/GaletteObjectsLend/
19 changes: 3 additions & 16 deletions _config.inc.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
<?php

/**
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
* Galette is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Galette is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
* This file is part of Galette Objects Lend plugin (https://galette.eu).
* SPDX-FileCopyrightText: Copyright © 2013-2026 The Galette Team
* SPDX-License-Identifier: GPL-3.0-or-later
*/

declare(strict_types=1);
Expand Down
19 changes: 3 additions & 16 deletions _define.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
<?php

/**
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
* Galette is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Galette is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
* This file is part of Galette Objects Lend plugin (https://galette.eu).
* SPDX-FileCopyrightText: Copyright © 2013-2026 The Galette Team
* SPDX-License-Identifier: GPL-3.0-or-later
*/

declare(strict_types=1);
Expand Down
19 changes: 3 additions & 16 deletions _routes.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
<?php

/**
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
* Galette is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Galette is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
* This file is part of Galette Objects Lend plugin (https://galette.eu).
* SPDX-FileCopyrightText: Copyright © 2013-2026 The Galette Team
* SPDX-License-Identifier: GPL-3.0-or-later
*/

declare(strict_types=1);
Expand Down
6 changes: 6 additions & 0 deletions bin/release
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/python

/**
* This file is part of Galette Objects Lend plugin (https://galette.eu).
* SPDX-FileCopyrightText: Copyright © 2013-2026 The Galette Team
* SPDX-License-Identifier: GPL-3.0-or-later
*/

import os, sys, argparse, re, git, http.client, subprocess
import urlgrabber.progress, tarfile, shutil, gitdb, time, fnmatch
from datetime import datetime
Expand Down
6 changes: 6 additions & 0 deletions bin/twig-cache
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/php
<?php

/**
* This file is part of Galette Objects Lend plugin (https://galette.eu).
* SPDX-FileCopyrightText: Copyright © 2013-2026 The Galette Team
* SPDX-License-Identifier: GPL-3.0-or-later
*/

use Twig\Cache\CacheInterface;
use Twig\Cache\FilesystemCache;
use Twig\Environment;
Expand Down
19 changes: 3 additions & 16 deletions lib/GaletteObjectsLend/Controllers/Crud/CategoriesController.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
<?php

/**
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
* Galette is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Galette is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
* This file is part of Galette Objects Lend plugin (https://galette.eu).
* SPDX-FileCopyrightText: Copyright © 2013-2026 The Galette Team
* SPDX-License-Identifier: GPL-3.0-or-later
*/

declare(strict_types=1);
Expand Down
19 changes: 3 additions & 16 deletions lib/GaletteObjectsLend/Controllers/Crud/ObjectsController.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
<?php

/**
* Copyright © 2003-2026 The Galette Team
*
* This file is part of Galette (https://galette.eu).
*
* Galette is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Galette is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Galette. If not, see <http://www.gnu.org/licenses/>.
* This file is part of Galette Objects Lend plugin (https://galette.eu).
* SPDX-FileCopyrightText: Copyright © 2013-2026 The Galette Team
* SPDX-License-Identifier: GPL-3.0-or-later
*/

declare(strict_types=1);
Expand Down
Loading
Loading