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

Adjust to atk4 3.0 #76

Merged
merged 92 commits into from
Oct 16, 2021
Merged
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
3a95b46
Align with atk4/core workflow
abbadon1334 Apr 23, 2021
88b854a
Add Behat test workflow from Atk4/Ui
abbadon1334 Apr 23, 2021
6d184a2
Remove js compilation from Behat tests
abbadon1334 Apr 23, 2021
8b22b4f
Update composer.json
abbadon1334 Apr 23, 2021
094bc33
Add phpstan.neon.dist from Atk4/Data, removed ignoreErrors
abbadon1334 Apr 23, 2021
1dde055
Remove creation of db
abbadon1334 Apr 23, 2021
1080792
Initial Fixes phpstan
abbadon1334 Apr 23, 2021
01acd93
Fix Namespace case
abbadon1334 Apr 23, 2021
97124d7
demo rename login.php to form-login.php
abbadon1334 Apr 23, 2021
157e26f
Re-Add create-sqlite-db.php
abbadon1334 Apr 23, 2021
c01258e
Fix path & fqcn
abbadon1334 Apr 23, 2021
260e685
Fix database creation
abbadon1334 Apr 23, 2021
8240c48
Fix release dep to 2.5
abbadon1334 Apr 23, 2021
f814c3e
Start fixing behat
abbadon1334 Apr 23, 2021
5b3b712
Drop inherited dependency from require-release
abbadon1334 Apr 23, 2021
1ee9044
Fix Behat
abbadon1334 Apr 23, 2021
27b1612
Fix add -> addTo
abbadon1334 Apr 23, 2021
774ec21
BugFix : hardcoded field login as email when use default Form/Login
abbadon1334 Apr 23, 2021
f5c1610
Fix access to array
abbadon1334 Apr 23, 2021
599e921
Remove useless [] when called new Array_()
abbadon1334 Apr 23, 2021
ab096e0
Fix UnitTest Array Access error using new way Array_/Db/Table/Rows
abbadon1334 Apr 23, 2021
adbfe14
CS-Fix
abbadon1334 Apr 23, 2021
62c482c
Add Stan generated baseline
abbadon1334 Apr 23, 2021
774e9d2
Add Stan generated baseline
abbadon1334 Apr 23, 2021
d213e23
Demo : Align layout form register to form login
abbadon1334 Apr 23, 2021
dfc8dcd
Rename basic.feature to login.feature
abbadon1334 Apr 23, 2021
3e94666
Add Behat register.feature
abbadon1334 Apr 23, 2021
35b2d41
Align Login and Register to internally use fieldLogin and fieldPasswo…
abbadon1334 Apr 23, 2021
e4bf506
CS-Fix
abbadon1334 Apr 23, 2021
d920c5e
Clean up
abbadon1334 Apr 24, 2021
37545e9
Change from GetProtected to Model->export
abbadon1334 Apr 24, 2021
b35c531
CS Fix
abbadon1334 Apr 24, 2021
b6bd1bd
Fix add sleep(1) to right file.
abbadon1334 Apr 26, 2021
2d70c57
change init.php to init-app.php like in Atk4/Ui, to avoid errors on i…
abbadon1334 Apr 26, 2021
e4ccc68
Add 1 phpstan-ignore
abbadon1334 Apr 26, 2021
60d07b9
FIX : one FQCN error and removed from stan
abbadon1334 Apr 26, 2021
7e615b6
Solving phpstan errors
abbadon1334 Apr 26, 2021
58e7d5b
fix array persistence test
DarkSide666 Apr 26, 2021
8ea3197
Merge branch 'feature/fix-table' of https://github.com/atk4/login int…
abbadon1334 Apr 26, 2021
8dd1849
Fix : removing Array_($a /* empty array */) to Array_()
abbadon1334 Apr 26, 2021
deb5d1d
test behat
DarkSide666 Apr 26, 2021
635e227
test
DarkSide666 Apr 26, 2021
581c94f
contains?
DarkSide666 Apr 26, 2021
09ac020
contains
DarkSide666 Apr 26, 2021
60d0e98
hmmm
DarkSide666 Apr 26, 2021
cb6fcd5
test
DarkSide666 Apr 26, 2021
126c8af
hmm2
DarkSide666 Apr 26, 2021
d20cef0
test again
DarkSide666 Apr 26, 2021
c0a9744
rollback
DarkSide666 Apr 26, 2021
eb4f5eb
test behat & rollback
DarkSide666 Apr 26, 2021
596e985
try to fix behat
abbadon1334 Apr 26, 2021
17a5100
Merge remote-tracking branch 'origin/update-release-workflow' into up…
abbadon1334 Apr 26, 2021
bbc35da
try to fix behat
abbadon1334 Apr 26, 2021
53f7904
try to fix behat
abbadon1334 Apr 26, 2021
1c50bc6
try to fix behat
abbadon1334 Apr 26, 2021
ea0a6f0
Remove failing tests. Not to be tested in this repo
abbadon1334 Apr 27, 2021
f0f6b20
Fix : Model::data now is private switch to &getDataRef()
abbadon1334 Apr 27, 2021
61d8acd
Use setMulti (getDataRef is internal)
abbadon1334 Apr 29, 2021
46a0854
Rollback [Unit-Burn] using ui settings for testing leaks + Behat [Chr…
abbadon1334 Apr 29, 2021
9bd9d8f
Use Atk4/Ui/Behat/Context
abbadon1334 May 12, 2021
27dc12e
Set require to atk4/ui 2.4 for release
abbadon1334 Jun 10, 2021
c2a6562
Add conditional to local run https://github.com/nektos/act
abbadon1334 Jun 10, 2021
26b8843
Fix password test for 2.4
abbadon1334 Jun 10, 2021
aef6b25
CS fix
abbadon1334 Jun 10, 2021
0ebdb38
Merge branch 'develop' into update-release-workflow
abbadon1334 Jun 10, 2021
db1a2df
Add Behat context file for 2.4 release
abbadon1334 Jun 10, 2021
1cb4c33
Rename deprecated filename for cs-fixer
abbadon1334 Jun 10, 2021
d0109c2
Adjust Behat conf
abbadon1334 Jun 10, 2021
67d4142
Merge remote-tracking branch 'origin/update-release-workflow' into up…
abbadon1334 Jun 10, 2021
82e0e2e
Fix phpstan
abbadon1334 Jun 10, 2021
9c12a8e
Fix memory leak
abbadon1334 Jun 10, 2021
f503010
remove condition, exception will throw before (in method fieldExists)
abbadon1334 Jun 10, 2021
1fff1b2
align composer to dev-develop
abbadon1334 Jun 11, 2021
6779a0d
Remove internal behat context
abbadon1334 Jun 11, 2021
a23cc24
Fix Behat with Atk4/Ui Behat context
abbadon1334 Jun 11, 2021
f11b858
Fix Entity 3.0
abbadon1334 Jun 11, 2021
1c1ae57
Fix Entity 3.0
abbadon1334 Jun 12, 2021
1a647a0
Add hook on afterload to recover passwordHash after createEntity
abbadon1334 Jun 12, 2021
63d691d
Add hook on afterunload cleanup passwordHash
abbadon1334 Jun 12, 2021
c2db1dc
Fix Entity 3.0
abbadon1334 Jun 12, 2021
af185fc
Drop support for PHP 7.3
abbadon1334 Jun 12, 2021
4916f02
Fix Cs-Fixer
abbadon1334 Jun 12, 2021
36af1e6
Fix Entity 3.0
abbadon1334 Jun 12, 2021
0da7709
Add type to anonymous function params
abbadon1334 Jun 12, 2021
8e9079e
clean behat file
abbadon1334 Jun 12, 2021
7479948
Add rule on phpstan
abbadon1334 Jun 12, 2021
d774916
Merge branch 'develop' into update/3.0
mvorisek Oct 14, 2021
5778382
Unify CI files and fix for atk4/ui 3.0
mvorisek Oct 15, 2021
8715468
Fix composer.json CS
mvorisek Oct 16, 2021
8990f11
Merge branch 'release/2.4' into update/3.0
mvorisek Oct 16, 2021
c25d272
fix/sync html with pug template
mvorisek Oct 16, 2021
f667cda
fix all pug
mvorisek Oct 16, 2021
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
1 change: 0 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ categories:
- "Documentation :books:"
template: |
## What’s Changed

$CHANGES
15 changes: 15 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build Docs

on:
push:
branches:
- develop

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- name: Run Release Drafter
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Release

on:
push:
branches:
- '**\.build'
- 'release/*'
- '!**\.gen'

jobs:
autocommit:
name: Build Release
runs-on: ubuntu-latest
container:
image: atk4/image:latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Install PHP dependencies
run: composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader

- name: Composer unset version
run: composer config version --unset

- name: Update composer.json
run: >-
php -r '
$f = __DIR__ . "/composer.json";
$data = json_decode(file_get_contents($f), true);
foreach ($data as $k => $v) {
if (preg_match("~^(.+)-release$~", $k, $matches)) {
$data[$matches[1]] = $data[$k]; unset($data[$k]);
}
}
$str = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . "\n";
echo $str;
file_put_contents($f, $str);
'

- name: Composer validate config
run: composer validate --strict --no-check-lock && composer normalize --dry-run --no-check-lock

- name: Commit
run: |
git config --global user.name "$(git show -s --format='%an')"
git config --global user.email "$(git show -s --format='%ae')"
git add -A && git diff --staged && git commit -m "Build Release"

- name: Push
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}.gen
force: true
github_token: ${{ secrets.GITHUB_TOKEN }}
30 changes: 0 additions & 30 deletions .github/workflows/bundler.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/release-drafter.yml

This file was deleted.

205 changes: 205 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
name: Unit

on:
pull_request:
push:
schedule:
- cron: '0 0/2 * * *'

jobs:
smoke-test:
name: Smoke
runs-on: ubuntu-latest
container:
image: atk4/image:${{ matrix.php }}
strategy:
fail-fast: false
matrix:
php: ['latest']
type: ['Phpunit']
include:
- php: 'latest'
type: 'CodingStyle'
- php: 'latest'
type: 'StaticAnalysis'
env:
LOG_COVERAGE: ""
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Configure PHP
run: |
if [ -n "$LOG_COVERAGE" ]; then echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; else rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; fi
php --version

- name: Setup cache 1/2
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Setup cache 2/2
if: ${{ !env.ACT }}
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-smoke-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-

- name: Install PHP dependencies
run: |
if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpunit/phpunit johnkary/phpunit-speedtrap --dev ; fi
if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer --dev ; fi
if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/phpstan --dev ; fi
composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader

- name: Init
run: |
mkdir -p build/logs

- name: "Run tests: Phpunit (only for Phpunit)"
if: matrix.type == 'Phpunit'
run: "vendor/bin/phpunit \"$(if [ -n \"$LOG_COVERAGE\" ]; then echo '--coverage-text'; else echo '--no-coverage'; fi)\" -v"

- name: Check Coding Style (only for CodingStyle)
if: matrix.type == 'CodingStyle'
run: vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --diff --diff-format=udiff --verbose --show-progress=dots

- name: Run Static Analysis (only for StaticAnalysis)
if: matrix.type == 'StaticAnalysis'
run: |
echo "memory_limit = 1G" > /usr/local/etc/php/conf.d/custom-memory-limit.ini
vendor/bin/phpstan analyse

unit-test:
name: Unit
runs-on: ubuntu-latest
container:
image: atk4/image:${{ matrix.php }}
strategy:
fail-fast: false
matrix:
php: ['7.4', 'latest']
type: ['Phpunit']
include:
- php: 'latest'
type: 'Phpunit Lowest'
- php: 'latest'
type: 'Phpunit Burn'
env:
LOG_COVERAGE: "${{ fromJSON('{true: \"1\", false: \"\"}')[matrix.php == 'latest' && matrix.type == 'Phpunit' && (github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')))] }}"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Configure PHP
run: |
if [ -n "$LOG_COVERAGE" ]; then echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; else rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; fi
php --version

- name: Setup cache 1/2
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Setup cache 2/2
if: ${{ !env.ACT }}
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-

- name: Install PHP dependencies
run: |
if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "Phpunit Lowest" ] && [ "${{ matrix.type }}" != "Phpunit Burn" ]; then composer remove --no-interaction --no-update phpunit/phpunit --no-update phpunit/phpunit johnkary/phpunit-speedtrap --dev ; fi
if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer --dev ; fi
if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/phpstan --dev ; fi
composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader
if [ "${{ matrix.type }}" == "Phpunit Lowest" ]; then composer update --ansi --prefer-dist --prefer-lowest --prefer-stable --no-interaction --no-progress --optimize-autoloader ; fi
if [ "${{ matrix.type }}" == "Phpunit Burn" ]; then sed -i 's/ *public function runBare(): void/public function runBare(): void { gc_collect_cycles(); $mem0 = memory_get_usage(); for ($i = 0; $i < '"$(if [ \"$GITHUB_EVENT_NAME\" == \"schedule\" ]; then echo 5; else echo 5; fi)"'; ++$i) { $this->_runBare(); if ($i === 0) { gc_collect_cycles(); $mem1 = memory_get_usage(); } } gc_collect_cycles(); $mem2 = memory_get_usage(); if ($mem2 - 4000 * 1024 > $mem0 || $mem2 - 1536 * 1024 > $mem1) { $this->onNotSuccessfulTest(new AssertionFailedError("Memory leak detected! (" . round($mem0 \/ (1024 * 1024), 3) . " + " . round(($mem1 - $mem0) \/ (1024 * 1024), 3) . " + " . round(($mem2 - $mem1) \/ (1024 * 1024), 3) . " MB, " . $i . " iterations)")); } } private function _runBare(): void/' vendor/phpunit/phpunit/src/Framework/TestCase.php && cat vendor/phpunit/phpunit/src/Framework/TestCase.php | grep '_runBare(' ; fi

- name: Init
run: |
mkdir -p build/logs

- name: "Run tests: Phpunit (only for Phpunit)"
if: startsWith(matrix.type, 'Phpunit')
run: "vendor/bin/phpunit \"$(if [ -n \"$LOG_COVERAGE\" ]; then echo '--coverage-text'; else echo '--no-coverage'; fi)\" -v"

- name: Upload coverage logs (only for "latest" Phpunit)
if: env.LOG_COVERAGE
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: build/logs/clover.xml

behat-test:
name: Behat
runs-on: ubuntu-latest
container:
image: atk4/image:${{ matrix.php }}
strategy:
fail-fast: false
matrix:
php: ['latest-npm']
type: ['Chrome', 'Firefox', 'Chrome Lowest', 'Chrome Slow']
env:
LOG_COVERAGE: ''
services:
selenium-chrome:
image: selenium/standalone-chrome:latest
options: --health-cmd "/opt/bin/check-grid.sh"
selenium-firefox:
image: selenium/standalone-firefox:latest
options: --health-cmd "/opt/bin/check-grid.sh"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Configure PHP
run: |
if [ -n "$LOG_COVERAGE" ]; then echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; else rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; fi
php --version

- name: Setup cache 1/2
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Setup cache 2/2
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-

- name: Install PHP dependencies
run: |
composer remove --no-interaction --no-update phpunit/phpunit johnkary/phpunit-speedtrap phpunit/phpcov --dev
composer remove --no-interaction --no-update friendsofphp/php-cs-fixer --dev
composer remove --no-interaction --no-update phpstan/phpstan --dev
composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader
if [ "${{ matrix.type }}" == "Chrome Lowest" ]; then composer update --ansi --prefer-dist --prefer-lowest --prefer-stable --no-interaction --no-progress --optimize-autoloader ; fi

- name: Init
run: |
mkdir -p build/logs
php demos/_demo-data/create-sqlite-db.php

- name: "Run tests: Behat"
run: |
php -S 172.18.0.2:8888 > /dev/null 2>&1 &
sleep 1
if [ "${{ matrix.type }}" == "Firefox" ]; then sed -i "s~chrome~firefox~" behat.yml.dist ; fi
if [ "${{ matrix.type }}" == "Chrome Slow" ]; then echo 'sleep(1);' >> demos/init-app.php ; fi

# remove once https://github.com/minkphp/Mink/pull/801
# and https://github.com/minkphp/MinkSelenium2Driver/pull/322 are released
sed -i 's/usleep(100000)/usleep(5000)/' vendor/behat/mink/src/Element/Element.php
sed -i 's/usleep(100000)/usleep(5000)/' vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php

vendor/bin/behat -vv --config behat.yml.dist
Loading