Skip to content

Commit

Permalink
Merge branch 'develop' into feature/action_button_disable
Browse files Browse the repository at this point in the history
  • Loading branch information
dtemaster committed Aug 21, 2023
2 parents c3b94a2 + d6c8af0 commit a17e5b6
Show file tree
Hide file tree
Showing 674 changed files with 165,188 additions and 77,720 deletions.
15 changes: 5 additions & 10 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
categories:
- title: "Breaking Changes"
labels:
- "BC-break"
- title: "Major Features"
- title: "Major features"
labels:
- "MAJOR"
- title: "Documentation enhancements"
- title: "Breaking changes"
labels:
- "Documentation :books:"
template: |
## What’s Changed
$CHANGES
- "BC-break"
- title: "Other changes"
template: $CHANGES
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Build Docs
name: Build changelog

on:
push:
branches:
- develop

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

on:
push:
Expand Down
121 changes: 82 additions & 39 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
- name: Setup cache 1/2
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Setup cache 2/2
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-smoke-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }}
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
php: ['7.4', '8.0', '8.1', '8.2']
type: ['Phpunit', 'Phpunit Lowest']
include:
- php: '8.1' # TODO replace with 'latest' once it represents at least PHP 8.1
- php: 'latest'
type: 'Phpunit Burn'
env:
LOG_COVERAGE: "${{ fromJSON('{true: \"1\", false: \"\"}')[matrix.php == '8.0' && matrix.type == 'Phpunit' && (github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')))] }}"
Expand All @@ -92,7 +92,7 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=atk4_pass_root -e MYSQL_USER=atk4_test_user -e MYSQL_PASSWORD=atk4_pass -e MYSQL_DATABASE=atk4_test --entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
mariadb:
image: mariadb
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=atk4_pass_root -e MYSQL_USER=atk4_test_user -e MYSQL_PASSWORD=atk4_pass -e MYSQL_DATABASE=atk4_test
options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=atk4_pass_root -e MYSQL_USER=atk4_test_user -e MYSQL_PASSWORD=atk4_pass -e MYSQL_DATABASE=atk4_test
postgres:
image: postgres:12-alpine
env:
Expand Down Expand Up @@ -121,10 +121,10 @@ jobs:
- name: Setup cache 1/2
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Setup cache 2/2
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }}
Expand Down Expand Up @@ -224,10 +224,11 @@ jobs:
- name: Upload coverage logs 2/2 (only for latest Phpunit)
if: env.LOG_COVERAGE
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/merged.xml
fail_ci_if_error: true
files: coverage/merged.xml

behat-test:
name: Behat
Expand All @@ -252,7 +253,7 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=atk4_pass_root -e MYSQL_USER=atk4_test_user -e MYSQL_PASSWORD=atk4_pass -e MYSQL_DATABASE=atk4_test --entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
mariadb:
image: mariadb
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=atk4_pass_root -e MYSQL_USER=atk4_test_user -e MYSQL_PASSWORD=atk4_pass -e MYSQL_DATABASE=atk4_test
options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=atk4_pass_root -e MYSQL_USER=atk4_test_user -e MYSQL_PASSWORD=atk4_pass -e MYSQL_DATABASE=atk4_test
postgres:
image: postgres:12-alpine
env:
Expand Down Expand Up @@ -281,54 +282,64 @@ jobs:
- name: Setup cache 1/2
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Setup cache 2/2
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-behat-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install JS dependencies (only for Slow)
if: matrix.type == 'Chrome Slow'
run: |
mv public public.orig
mkdir public public/external
cp public.orig/.gitignore public
cp public.orig/agileui.less public
cp public.orig/logo.png public
cp public.orig/external/.gitignore public/external
cp public.orig/external/package.json public/external
cp public.orig/external/package-lock.json public/external
cp public.orig/external/postinstall.js public/external
npm install --loglevel=error -g pug-cli less less-plugin-clean-css uglify-js
(cd js && npm ci --loglevel=error)
# uncomment and remove line below once Fomantic-UI 2.9.0 is released (cd public/external && npm ci --loglevel=error && git clean -dxfq .)
(cd public/external && npm ci --ignore-scripts --loglevel=error && npm run postinstall && git clean -dxfq .)
- name: Install JS dependencies (only for coverage or Slow)
if: env.LOG_COVERAGE || matrix.type == 'Chrome Slow'
run: |
if [ -n "$LOG_COVERAGE" ]; then
(cd js && npm install --package-lock-only --save-dev babel-plugin-istanbul nyc && npm ci --loglevel=error)
else
mv public public.orig
mkdir public public/css public/external
cp public.orig/.gitattributes public
cp public.orig/.gitignore public
cp public.orig/logo.png public
cp public.orig/css/agileui.less public/css
cp public.orig/external/.gitignore public/external
cp public.orig/external/package.json public/external
cp public.orig/external/package-lock.json public/external
cp public.orig/external/postinstall.js public/external
npm install --loglevel=error -g pug-cli less less-plugin-clean-css uglify-js
(cd js && npm ci --loglevel=error)
(cd public/external && npm ci --loglevel=error && git clean -dxfq .)
fi
- name: Lint JS files (only for Slow)
if: matrix.type == 'Chrome Slow'
run: |
(cd js && npm run lint ../public/external/\*.js)
cp public/external/postinstall.js js
(cd js && npm run lint)
- name: Compile HTML files (only for Slow)
if: matrix.type == 'Chrome Slow'
run: |
cp -r template template.orig
find template -not -type d -not -name '*.pug' -delete
(cd template && pug --silent --pretty .)
(cd template && pug --doctype html --pretty --silent .)
- name: Compile CSS files (only for Slow)
if: matrix.type == 'Chrome Slow'
run: |
lessc public/agileui.less public/agileui.min.css --clean-css="--s1 --advanced" --source-map
lessc public/css/agileui.less public/css/agileui.min.css --clean-css="--s1 --advanced" --source-map
- name: Compile JS files (only for Slow)
if: matrix.type == 'Chrome Slow'
- name: Compile JS files (only for coverage or Slow)
if: env.LOG_COVERAGE || matrix.type == 'Chrome Slow'
run: |
(cd js && npm run build)
if [ -n "$LOG_COVERAGE" ]; then
rm -r public/js
(cd js && ISTANBUL_COVERAGE=1 npm run build)
else
(cd js && npm run build)
fi
- name: Diff compiled files (only for Slow)
if: matrix.type == 'Chrome Slow'
Expand All @@ -352,7 +363,7 @@ jobs:
php -r '(new PDO("mysql:host=mariadb", "root", "atk4_pass_root"))->exec("ALTER USER '"'"'atk4_test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 5");'
php -r '(new PDO("pgsql:host=postgres;dbname=atk4_test", "atk4_test_user", "atk4_pass"))->exec("ALTER ROLE atk4_test_user CONNECTION LIMIT 1");'
/usr/lib/oracle/setup.sh
if [ -n "$LOG_COVERAGE" ]; then mkdir coverage; fi
if [ -n "$LOG_COVERAGE" ]; then mkdir coverage coverage/js; fi
ci_wait_until () { timeout 30 sh -c "until { $1 2> /dev/null; }; do sleep 0.02; done" || timeout 15 sh -c "$1" || { echo "health timeout: $1"; exit 1; }; }
php -d opcache.enable_cli=1 -S 127.0.0.1:8888 > /dev/null 2>&1 &
ci_wait_until 'nc -w 1 127.0.0.1 8888'
Expand Down Expand Up @@ -425,15 +436,47 @@ jobs:
php demos/_demo-data/create-db.php
vendor/bin/behat -vv --config behat.yml.dist
- name: Upload coverage logs 1/2 (only for latest Chrome)
- name: Upload coverage logs 1/2 (only for coverage)
if: env.LOG_COVERAGE
run: |
ls -l coverage | wc -l
php -d memory_limit=2G vendor/bin/phpcov merge coverage/ --clover coverage/merged.xml
- name: Upload coverage logs 2/2 (only for latest Chrome)
ls -l coverage/js | wc -l
(cd js && npx nyc report --temp-dir ../coverage/js --report-dir ../coverage/js -e vue --reporter=clover)
# fix never reached condition is rendered to clover with falsecount > 0
# https://github.com/istanbuljs/istanbuljs/issues/695
sed -i -E 's~count="0" type="cond" truecount="0" falsecount="[1-9]+[0-9]*"~count="0" type="cond" truecount="0" falsecount="0"~' coverage/js/clover.xml
sed -i -E 's~count="[0-9]+" type="cond" truecount="[1-9]+[0-9]*" falsecount="[0-9]+"~count="1" type="cond" truecount="1" falsecount="1"~' coverage/js/clover.xml
- name: Upload coverage logs 2/2 (only for coverage)
if: env.LOG_COVERAGE
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/merged.xml
fail_ci_if_error: true
files: coverage/merged.xml,coverage/js/clover.xml

docs-test:
name: Docs
runs-on: ubuntu-latest
container:
image: ghcr.io/mvorisek/image-php:latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Python and dependencies
run: |
apk add python3 py3-pip
python --version
(cd docs && pip install -r requirements.txt)
- name: Build
run: |
mv docs/baseline.txt docs/baseline.orig.txt
(cd docs && python -m sphinx -T -b html . out 2>&1 | tee baseline.txt)
sed -i -r 's~[^:]*/docs/([^:]*:)([0-9]+:)?~\1~;t;d' docs/baseline.txt
- name: Diff build baseline
run: |
diff -u docs/baseline.orig.txt docs/baseline.txt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ cache
*.cache.*

/demos/db.php
/demos/db-behat-rw.txt
/demos/_demo-data/db.sqlite
/demos/_demo-data/db.sqlite-journal
/phpunit.xml
Expand Down
7 changes: 1 addition & 6 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@
->setRules([
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHP74Migration:risky' => true,
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,

// required by PSR-12
'concat_space' => [
'spacing' => 'one',
],

// disable some too strict rules
'phpdoc_types' => [
// keep enabled, but without "alias" group to not fix
// "Callback" to "callback" in phpdoc
'groups' => ['simple', 'meta'],
],
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
Expand Down
Loading

0 comments on commit a17e5b6

Please sign in to comment.