Skip to content

Commit 28811eb

Browse files
committed
WIP fix CI
1 parent 9389c82 commit 28811eb

3 files changed

Lines changed: 25 additions & 33 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,33 +41,11 @@ jobs:
4141
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
4242
restore-keys: ${{ runner.os }}-composer-
4343

44-
- uses: actions/cache@v4
45-
with:
46-
path: ~/.cache/yarn
47-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48-
restore-keys: ${{ runner.os }}-yarn-
49-
50-
- name: Setup problem matchers for PHP
51-
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
52-
53-
- name: Setup problem matchers for PHPUnit
54-
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
5544

5645
# Prepare our app
5746
- run: mysql --protocol=tcp --user=root --execute='SET GLOBAL sql_mode = "";'
5847
- run: cp config/autoload/local.php.dist config/autoload/local.php
5948
- run: ./bin/build.sh
6049
- run: ./bin/load-test-data.php --no-interaction
6150

62-
# Lint and tests
63-
- run: ./vendor/bin/php-cs-fixer fix --format=checkstyle | cs2pr
64-
- run: ./vendor/bin/phpstan analyse
65-
- run: ./vendor/bin/phpunit --coverage-clover coverage-clover.xml
66-
- run: yarn lint
67-
- run: ./node_modules/.bin/prettier --check .
68-
- run: ./node_modules/.bin/ng test --progress false --watch=false --browsers ChromeHeadlessCustom
69-
70-
- name: Upload code coverage
71-
run: |
72-
composer global require scrutinizer/ocular
73-
~/.composer/vendor/bin/ocular code-coverage:upload --format=php-clover coverage-clover.xml
51+
- run: ./vendor/bin/phpunit --filter testLoginFailedOften

bin/build.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ return [
6161
];" > config/autoload/version.local.php
6262

6363
echo "Installing git hooks..."
64-
ln -fs ../../bin/pre-commit.sh .git/hooks/pre-commit
64+
#ln -fs ../../bin/pre-commit.sh .git/hooks/pre-commit
6565

6666
echo "Updating Node.js packages..."
67-
yarn install $NO_PROGRESS
67+
#yarn install $NO_PROGRESS
6868

6969
echo "Updating all PHP dependencies via composer..."
7070
$COMPOSER install --classmap-authoritative $NO_PROGRESS
@@ -79,11 +79,3 @@ $PHP ./bin/create-triggers.php
7979

8080
echo "Delete old logs..."
8181
$PHP ./bin/delete-old-log.php
82-
83-
if [ $IS_PRODUCTION -eq 1 ]; then
84-
echo "Building Angular application..."
85-
yarn run prod
86-
else
87-
echo "Running Angular dev server..."
88-
yarn run dev
89-
fi

tests/ApplicationTest/Repository/LogRepositoryTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use Application\Model\Log;
88
use Application\Repository\LogRepository;
9+
use DateTimeImmutable;
10+
use DateTimeZone;
11+
use Monolog\JsonSerializableDateTimeImmutable;
912

1013
class LogRepositoryTest extends AbstractRepositoryTest
1114
{
@@ -30,6 +33,25 @@ public function testLoginFailedOften(): void
3033
}
3134

3235
$result = $this->repository->loginFailedOften();
36+
37+
$select = $this->getEntityManager()->getConnection()->createQueryBuilder()
38+
->select('creation_date, level, message')
39+
->from('log')
40+
->orderBy('id', 'DESC');
41+
42+
$events = $select->executeQuery()->fetchAssociative();
43+
44+
$c = $this->getEntityManager()->getConnection();
45+
ve([
46+
'db settings' => $c->fetchAllAssociative('SELECT @@system_time_zone AS system_time_zone, @@global.time_zone AS global_timezone, @@session.time_zone AS session_timezone, DATE_SUB(NOW(), INTERVAL 30 MINUTE) as limits;'),
47+
'db results' => $events,
48+
'date_default_timezone_get()' => date_default_timezone_get(),
49+
'DateTime' => (new DateTimeImmutable('now'))->format('c'),
50+
'DateTimeImmutable' => (new DateTimeImmutable('now'))->format('c'),
51+
'DateTimeImmutable with zone' => (new DateTimeImmutable('now', new DateTimeZone(date_default_timezone_get())))->format('c'),
52+
'JsonSerializableDateTimeImmutable' => (new JsonSerializableDateTimeImmutable(false, new DateTimeZone(date_default_timezone_get())))->format('c'),
53+
]);
54+
3355
self::assertTrue($result, 'is your PHP date.timezone setting correct ?');
3456
}
3557

0 commit comments

Comments
 (0)