Make PHP 8.3 work #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test code formating guidelines | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test-code-format: | |
runs-on: "ubuntu-latest" | |
container: "ubuntu:23.04" | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
TZ: "Etc/GMT" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Link correct timezone to '/etc/localtime' | |
run: ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
- name: Run 'apt update' | |
run: apt update | |
- name: Install astyle | |
run: apt install -y astyle php-codesniffer | |
- name: Test code formating with astyle | |
run: astyle --indent=spaces=4 --style=1tbs --max-code-length=120 --lineend=linux --align-pointer=name --align-reference=name --add-braces --formatted --convert-tabs --break-after-logical --pad-oper --break-blocks=all --indent-col1-comments *.c *.h > c_format_output.txt | |
- name: Test code formating with PHPCS | |
run: phpcs tools/blencode.php > php_format_output.txt | |
- name: Test if there is problems | |
run: | | |
if [ "$(stat -c %s c_format_output.txt)" != "0" ] | |
then | |
echo "These C files are not formated as expected:" | |
cat c_format_output.txt | |
exit 1 | |
fi | |
if [ "$(stat -c %s php_format_output.txt)" != "0" ] | |
then | |
echo "These PHP files are not formated as expected:" | |
cat php_format_output.txt | |
exit 1 | |
fi |