Skip to content

Commit

Permalink
fixup! Correct baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Aug 13, 2024
1 parent 03d49a1 commit 22904d9
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ jobs:


# Note (not tested, from https://github.com/orgs/community/discussions/38361)
# To cancel jobs if one failes, the following action may help
# To cancel jobs if one fails, the following action may help
# - if: "failure()"
# uses: "andymckay/[email protected]"
28 changes: 24 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
exclude: (?x)^( htdocs/includes/ckeditor/.* )
exclude: (?x)^( htdocs/includes/ckeditor/.*|(\.[^/]*/.*))$
repos:
# Several miscellaneous checks and fix (on yaml files, end of files fix)
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -11,7 +11,12 @@ repos:
args: [--unsafe]
- id: check-json
- id: mixed-line-ending
exclude: (?x)^(htdocs/includes/tecnickcom/tcpdf/fonts/.*)$
# alternative for dev/tools/fixdosfiles.sh
exclude: |
(?x)^(htdocs/includes/tecnickcom/tcpdf/fonts/.*
|.*/CRLF.*.php # Files in swiftmailer
)$
args: [--fix=lf]
- id: trailing-whitespace
exclude_types: [markdown]
- id: end-of-file-fixer
Expand All @@ -31,7 +36,8 @@ repos:
rev: v6.2.1
hooks:
- id: beautysh
exclude: (?x)^(dev/setup/git/hooks/pre-commit)$
exclude:
(?x)^(dev/setup/git/hooks/pre-commit)$
args: [--tab]

# Run local script
Expand Down Expand Up @@ -66,6 +72,7 @@ repos:
--standard=dev/setup/codesniffer/ruleset.xml,
--report=emacs,
--severity=5,
--no-colors,
]
- alias: php-cs-with-cache
id: php-cs
Expand All @@ -76,6 +83,7 @@ repos:
--standard=dev/setup/codesniffer/ruleset.xml,
--report=emacs,
--severity=5,
--no-colors,
--cache=.cache/pre-commit/dolibarr-php-cs.cache,
.,
]
Expand Down Expand Up @@ -162,7 +170,19 @@ repos:
- dev/tools/codespell/codespell-lines-ignore.txt
- --uri-ignore-words-list
- ned

entry: bash -c '[ ! -x local.sh ] || ./local.sh'
- alias: codespell-ignores
#
# Update codespell ignore file.
#
# Execute with `pre-commit run codespell -a --hook-stage manual`
id: codespell
stages: [manual]
name: Update file with codespell exceptions
additional_dependencies: [tomli]
language: python
entry: bash -c '[ ! -x dev/tools/codespell/addCodespellIgnores.sh ] || dev/tools/codespell/addCodespellIgnores.sh'
pass_filenames: false
# Check some shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
Expand Down
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
- stage: PHP 7.0-8.1
if: type = push
php: '7.1'
env:
env:
- DB=postgresql
- TRAVIS_PHP_VERSION=7.1
- stage: PHP 7.0-8.1
if: type = pull_request OR type = push
php: '8.1'
env:
env:
- DB=mysql
- TRAVIS_PHP_VERSION=8.1
#- stage: PHP Dev
Expand Down Expand Up @@ -108,12 +108,12 @@ install:
- |
if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then
sudo update-alternatives --set php /usr/bin/php7.1
fi
fi
if [ "$TRAVIS_PHP_VERSION" = '8.1' ]; then
sudo update-alternatives --set php /usr/bin/php8.1
fi
fi
php -i | head -
- |
echo "Updating Composer config"
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
Expand Down Expand Up @@ -216,7 +216,7 @@ before_script:
#sudo mysqld_safe --skip-grant-tables --socket=/tmp/aaa
sudo mysqld_safe --skip-grant-tables --socket=/tmp/aaa &
sleep 3
sudo ps fauxww
sudo ps fauxww
echo "MySQL set root password"
sudo mysql -u root -h 127.0.0.1 -e "FLUSH PRIVILEGES; CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8'; ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'password'; CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON travis.* TO [email protected]; GRANT ALL PRIVILEGES ON travis.* TO [email protected]; FLUSH PRIVILEGES;"
echo "MySQL grant"
Expand All @@ -225,15 +225,15 @@ before_script:
sudo mysql -u root -h 127.0.0.1 -ppassword -e 'use mysql; select * from user;'
echo "List pid file"
sudo mysql -u root -h 127.0.0.1 -ppassword -e "show variables like '%pid%';"
#sudo kill `cat /var/lib/mysqld/mysqld.pid`
#sudo systemctl start mariadb
echo "MySQL grant"
sudo mysql -u root -h 127.0.0.1 -ppassword -e 'GRANT ALL PRIVILEGES ON travis.* TO [email protected];'
echo "MySQL flush"
sudo mysql -u root -h 127.0.0.1 -ppassword -e 'FLUSH PRIVILEGES;'
echo "MySQL load sql"
sudo mysql -u root -h 127.0.0.1 -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
fi
Expand Down Expand Up @@ -371,12 +371,12 @@ script:
echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE
echo '$'force_install_main_data_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $INSTALL_FORCED_FILE
#cat $INSTALL_FORCED_FILE
- |
echo "Upgrading Dolibarr"
# Ensure we catch errors with -e. Set this to +e if you want to go to the end to see log files.
# Note: We keep +e because with pgsql, one of upgrade process fails even if migration seems ok, so
# I disable stop on error to be able to continue.
# I disable stop on error to be able to continue.
set +e
cd htdocs/install
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
Expand Down Expand Up @@ -444,7 +444,7 @@ script:
- |
echo Result of migration scripts
ls -alrt $TRAVIS_BUILD_DIR/
echo Show content of last file
cat $TRAVIS_BUILD_DIR/"$(ls -rt $TRAVIS_BUILD_DIR/ | tail -n1)"
Expand Down Expand Up @@ -494,18 +494,18 @@ after_failure:
# Show upgrade log files
#for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
#do
#echo "Debugging informations for file $ficlog"
#echo "Debugging information for file $ficlog"
#cat $ficlog
#done
# Show Apache log file
echo "Debugging informations for file apache error.log"
echo "Debugging information for file apache error.log"
sudo tail -n 200 /var/log/apache2/travis_error_log
if [ "$DEBUG" = true ]; then
# Dolibarr log file
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
echo "Debugging information for file dolibarr.log (latest 50 lines)"
tail -n 200 $TRAVIS_BUILD_DIR/documents/dolibarr.log
# Database log file
echo "Debugging informations for file mysql error.log"
echo "Debugging information for file mysql error.log"
sudo tail -n 200 /var/log/mysql/error.log
# TODO: PostgreSQL log file
echo
Expand Down
Loading

0 comments on commit 22904d9

Please sign in to comment.