Skip to content

Release 1.0.0

Release 1.0.0 #29

Workflow file for this run

name: Code Style Check
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
- dev
workflow_dispatch:
permissions:
contents: read
pull-requests: write
jobs:
astyle-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install AStyle
run: |
sudo apt-get update && apt-get install -y lbzip2 build-essential cmake pkg-config libsdl2-dev || true
sudo apt-get install -f -y
wget https://sourceforge.net/projects/astyle/files/astyle/astyle%203.4/astyle-3.4.10.tar.bz2/download -O astyle.tar.bz2
tar -xf astyle.tar.bz2
cd astyle-3.4.10
mkdir -p as-gcc-exe
cd as-gcc-exe
cmake ../
make
sudo make install
- name: Check code style
run: |
astyle --version
# Find all C/C++ files
FILES=$(find src include -type f \( -name "*.cpp" -o -name "*.h" \))
if [ -z "$FILES" ]; then
echo "No C/C++ files found to check"
exit 0
fi
# Run astyle on all files
FORMATTED=$(astyle --options=.astylerc --dry-run --formatted "$FILES" 2>&1 || true)
if [ -n "$FORMATTED" ]; then
echo "⚠️ Code style issues found in the following files:"
echo "$FORMATTED"
echo ""
echo "To fix formatting, run:"
echo " astyle --options=.astylerc --recursive 'src/*' 'include/*'"
exit 1
else
echo "✅ All files are properly formatted!"
fi