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

Update CI #2

Merged
merged 3 commits into from
May 1, 2024
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
39 changes: 23 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,20 @@ on:
push:
branches:
- cake4
- cake3
pull_request:
branches:
- '*'
schedule:
- cron: "0 7 1 * *"
branches:
- cake4
- cake3

jobs:
testsuite:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
cakephp-version: ['4.4.*']
php-version: ['7.4', '8.0', '8.1']
cakephp-version: ['4.5.*']
php-version: ['7.4', '8.0', '8.1', '8.2']
db-type: ['mysql']
prefer-lowest: ['']
coverage: ['no']
Expand All @@ -31,11 +27,11 @@ jobs:
db-type: 'mysql:5.7'
prefer-lowest: 'prefer-lowest'
coverage: 'no'
- cakephp-version: '4.0.*'
php-version: '8.0'
db-type: 'mysql'
prefer-lowest: ''
coverage: 'no'
# - cakephp-version: '4.0.*'
# php-version: '8.0'
# db-type: 'mysql'
# prefer-lowest: ''
# coverage: 'no'

- cakephp-version: '4.1.*'
php-version: '7.2'
Expand Down Expand Up @@ -70,8 +66,19 @@ jobs:
prefer-lowest: ''
coverage: 'no'

- php-version: '8.1'
cakephp-version: '4.4.*'
- cakephp-version: '4.4.*'
php-version: '7.4'
db-type: 'mysql:5.7'
prefer-lowest: 'prefer-lowest'
coverage: 'no'
- cakephp-version: '4.4.*'
php-version: '8.2'
db-type: 'mysql'
prefer-lowest: ''
coverage: 'no'

- php-version: '8.2'
cakephp-version: '4.5.*'
db-type: 'mysql'
prefer-lowest: ''
coverage: 'coverage'
Expand Down Expand Up @@ -155,7 +162,7 @@ jobs:

cs-stan:
name: Coding Standard & Static Analysis
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
Expand All @@ -165,7 +172,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: mbstring, intl, apcu
coverage: none

Expand Down
8 changes: 4 additions & 4 deletions tests/TestCase/Model/Table/WorkTimesTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testMutation(): void
// set with DateInterval object
$now = FrozenTime::now();
$recordFromDateInterval = $this->table->newEntity([
'rest' => $now->diff($now->addDays(2)->addHour()->addMinutes(2)->addSeconds(3)),
'rest' => $now->diff($now->addDays(2)->addHours(1)->addMinutes(2)->addSeconds(3)),
]);
$this->assertInstanceOf(TimeInterval::class, $recordFromDateInterval->rest);
$this->assertSame('49:02:03', (string)$recordFromDateInterval->rest);
Expand All @@ -85,7 +85,7 @@ public function testEntityMutation(): void
// set with DateInterval object
$now = FrozenTime::now();
$recordFromDateInterval = $this->table->newEntity([]);
$recordFromDateInterval->duration = $now->diff($now->addDays(2)->addHour()->addMinutes(2)->addSeconds(3));
$recordFromDateInterval->duration = $now->diff($now->addDays(2)->addHours(1)->addMinutes(2)->addSeconds(3));
$this->assertInstanceOf(TimeInterval::class, $recordFromDateInterval->duration);
$this->assertSame('49:02:03', (string)$recordFromDateInterval->duration);

Expand All @@ -109,7 +109,7 @@ public function testSaveAs(): void

// set with DateInterval object and save
$now = FrozenTime::now();
$record->rest = $now->diff($now->addDays(2)->addHour()->addMinutes(2)->addSeconds(3));
$record->rest = $now->diff($now->addDays(2)->addHours(1)->addMinutes(2)->addSeconds(3));
$this->assertNotFalse($this->table->save($record));
$recordFromDateInterval = $this->table->get($record->id);
$this->assertInstanceOf(TimeInterval::class, $recordFromDateInterval->rest);
Expand All @@ -136,7 +136,7 @@ public function testSaveAsInt(): void

// set with DateInterval object and save
$now = FrozenTime::now();
$record->rest_seconds = $now->diff($now->addDays(2)->addHour()->addMinutes(2)->addSeconds(3));
$record->rest_seconds = $now->diff($now->addDays(2)->addHours(1)->addMinutes(2)->addSeconds(3));
$this->assertNotFalse($this->table->save($record));
$recordFromDateInterval = $this->table->get($record->id);
$this->assertInstanceOf(TimeInterval::class, $recordFromDateInterval->rest_seconds);
Expand Down
4 changes: 2 additions & 2 deletions tests/test_app/TestApp/Model/Table/WorkTimesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public function initialize(array $config): void
/**
* @inheritDoc
*/
protected function _initializeSchema(TableSchemaInterface $schema): TableSchemaInterface
public function getSchema(): TableSchemaInterface
{
parent::_initializeSchema($schema);
$schema = parent::getSchema();

$schema->setColumnType('rest', 'time_interval');
$schema->setColumnType('rest_seconds', 'time_interval_int');
Expand Down
Loading