Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add dependabot + update test with multi php version + composer update #1

Merged
merged 4 commits into from
Nov 18, 2023
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
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
timezone: "Europe/Paris"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
timezone: "Europe/Paris"
28 changes: 24 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ jobs:
validate:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
php-version:
- '7.4'
- '8.0'
- '8.1'
- '8.2'

services:
mysql:
image: mariadb:10.4
Expand All @@ -26,17 +37,26 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Validate
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
set: php-version.args.PHP_VERSION=${{ matrix.php-version }}
targets: validate

- name: Build Image Tests E2E
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
set: php-version.args.PHP_VERSION=${{ matrix.php-version }}
targets: test

- name: Run Image Tests E2E
run: docker run --rm -v $(pwd)/coverage:/src/coverage -e XDEBUG_MODE=coverage -e PHP_CS_FIXER_IGNORE_ENV=True --network host blueprintue-self-hosted-edition:test test
run: docker run --rm -v $(pwd)/coverage:/src/coverage -e XDEBUG_MODE=coverage -e PHP_CS_FIXER_IGNORE_ENV=True --network host blueprintue-self-hosted-edition:test test

- name: Upload coverage
uses: codecov/codecov-action@v3
if: success()
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/clover.xml
3 changes: 2 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
'=>' => 'align'
]
],
'braces' => false,
'concat_space' => [
'spacing' => 'one'
],
'declare_strict_types' => true,
'global_namespace_import' => false,
'linebreak_after_opening_tag' => true,
'mb_str_functions' => true,
'native_function_invocation' => [
Expand Down Expand Up @@ -55,6 +55,7 @@
__DIR__ . '/tests',
])
->name('*.php')
->exclude(['views/www/pages', 'views/www/parts'])
->ignoreDotFiles(true)
->ignoreVCS(true);

Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# blueprintUE self-hosted edition

![PHP Version Support](https://img.shields.io/badge/%3E%3D7.4.0-777BB4?label=php)
![MariaDB Version Support](https://img.shields.io/badge/%3E%3D10.6-003545?label=MariaDB)
![MySQL Version Support](https://img.shields.io/badge/%3E%3D8-005C84?label=MySQL)
![Use Docker](https://img.shields.io/badge/Docker-0db7ed)
[![Composer dependencies](https://img.shields.io/badge/dependencies-9-brightgreen)](https://github.com/blueprintue/blueprintue-self-hosted-edition/blob/main/composer.json)
[![Test workflow](https://img.shields.io/github/actions/workflow/status/blueprintue/blueprintue-self-hosted-edition/validate.yml?branch=main)](https://github.com/blueprintue/blueprintue-self-hosted-edition/actions/workflows/validate.yml)
[![Codecov](https://img.shields.io/codecov/c/github/blueprintue/blueprintue-self-hosted-edition?logo=codecov)](https://codecov.io/gh/blueprintue/blueprintue-self-hosted-edition)

## Minimum requirements
* \>= PHP 7.4
* \>= MySQL 8 or >= MariaDB 10.6
Expand Down Expand Up @@ -296,4 +304,4 @@ ANONYMOUS_ID=2
#### Nginx
* `REAL_IP_FROM` real ip from (by default: 0.0.0.0/32)
* `REAL_IP_HEADER` real ip header (by default: X-Forwarded-For)
* `LOG_IP_VAR` log ip var (by default: remote_addr)
* `LOG_IP_VAR` log ip var (by default: remote_addr)
8 changes: 4 additions & 4 deletions app/controllers/www/UploadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ protected function treatUpload(ServerRequestInterface $request, string $name, st
}

if (
$uploadParameters['canvas_width'] !== 310 || $uploadParameters['canvas_height'] !== 310 ||
$uploadParameters['mask_width'] !== 200 || $uploadParameters['mask_height'] !== 200 ||
$uploadParameters['mask_x'] !== 55 || $uploadParameters['mask_y'] !== 55
$uploadParameters['canvas_width'] !== 310 || $uploadParameters['canvas_height'] !== 310
|| $uploadParameters['mask_width'] !== 200 || $uploadParameters['mask_height'] !== 200
|| $uploadParameters['mask_x'] !== 55 || $uploadParameters['mask_y'] !== 55
) {
return [null, 'invalid constraints parameters'];
}
Expand Down Expand Up @@ -363,7 +363,7 @@ protected function createImageInMemory(UploadedFile $file, array $uploadParamete
}

/**
* @param $imgDest
* @param $imgDest
* @param string $folder
*
* @throws \Exception
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Helper
*
* @return string
*/
public static function getBlueprintLink(string $slug, ?int $version = null): string
public static function getBlueprintLink(string $slug, int $version = null): string
{
if ($version !== null) {
return Application::getRouter()->generateUrl('blueprint', ['blueprint_slug' => $slug, 'version' => $version]); // phpcs:ignore
Expand All @@ -37,7 +37,7 @@ public static function getBlueprintLink(string $slug, ?int $version = null): str
*
* @return string
*/
public static function getBlueprintRenderLink(string $slug, ?int $version = null): string
public static function getBlueprintRenderLink(string $slug, int $version = null): string
{
if ($version !== null) {
return Application::getRouter()->generateUrl('render', ['blueprint_slug' => $slug, 'version' => $version]);
Expand Down
1 change: 1 addition & 0 deletions app/services/www/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public static function createMemberUser(string $username, string $email, string
// @codeCoverageIgnoreStart
} catch (\Exception $exception) {
$forceRollback = true;

/*
* In end 2 end testing we can't arrive here because user requirements has been done before
* For covering we have to test the function outside
Expand Down
Loading