From 2309b8eb3fe021ff1bc7c651bf79f9083d54632e Mon Sep 17 00:00:00 2001 From: Adam Outler Date: Sun, 16 Nov 2025 18:58:20 -0500 Subject: [PATCH 1/3] Add linting and testing steps to workflow --- .github/workflows/code_checks.yml | 68 +++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index d5a164aa..1f2f81aa 100755 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -38,3 +38,71 @@ jobs: set -e echo "๐Ÿ” Checking Python syntax..." find . -name "*.py" -print0 | xargs -0 -n1 python3 -m py_compile + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install linting tools + run: | + # Python linting + pip install flake8 + # Docker linting + wget -O /tmp/hadolint https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 + chmod +x /tmp/hadolint + # PHP and shellcheck for syntax checking + sudo apt-get update && sudo apt-get install -y php-cli shellcheck + + - name: Shell check + continue-on-error: true + run: | + echo "๐Ÿ” Checking shell scripts..." + find . -name "*.sh" -exec shellcheck {} \; + + - name: Python lint + continue-on-error: true + run: | + echo "๐Ÿ” Linting Python code..." + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: PHP check + continue-on-error: true + run: | + echo "๐Ÿ” Checking PHP syntax..." + find . -name "*.php" -exec php -l {} \; + + - name: Docker lint + continue-on-error: true + run: | + echo "๐Ÿ” Linting Dockerfiles..." + /tmp/hadolint Dockerfile* || true + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install pytest + + - name: Run unit tests + run: | + echo "๐Ÿงช Running unit tests..." + pytest -m "not (docker or compose or feature_complete)" + From c7032bceba9e3342b352a75fc6815f66bc7e8188 Mon Sep 17 00:00:00 2001 From: Adam Outler Date: Sun, 16 Nov 2025 20:32:08 -0500 Subject: [PATCH 2/3] Upgrade Python setup action and dependencies Updated Python setup action to version 5 and specified Python version 3.11. Also modified dependencies installation to include pyyaml. --- .github/workflows/code_checks.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index 1f2f81aa..e14373d2 100755 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -46,9 +46,9 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.11' - name: Install linting tools run: | @@ -94,15 +94,16 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: '3.11' - name: Install dependencies run: | pip install -r requirements.txt - pip install pytest + pip install pytest pyyaml - name: Run unit tests run: | echo "๐Ÿงช Running unit tests..." + export PYTHONPATH=$PYTHONPATH:./server pytest -m "not (docker or compose or feature_complete)" From a93e87493f14b012421db95debdd2c56aeed29eb Mon Sep 17 00:00:00 2001 From: Adam Outler Date: Sun, 16 Nov 2025 20:33:53 -0500 Subject: [PATCH 3/3] Update Python setup action to version 5 --- .github/workflows/code_checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index e14373d2..48db0534 100755 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -92,7 +92,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11'