add container-based linting workflow using Forgejo Container Registry
Some checks failed
Build Deb-Mock Package / build (push) Successful in 1m36s
Lint Code / Lint All Code (push) Failing after 2s
Test Deb-Mock Build / test (push) Failing after 49s

This commit is contained in:
robojerk 2025-08-04 03:13:13 +00:00
parent 508a9beec9
commit c33e3aa9ac
2 changed files with 24 additions and 84 deletions

View file

@ -8,9 +8,11 @@ on:
workflow_dispatch:
jobs:
yaml-lint:
name: Lint YAML Files
lint-all:
name: Lint All Code
runs-on: ubuntu-latest
container:
image: git.raines.xyz/robojerk/deb-mock-linter:latest
steps:
- name: Checkout code
run: |
@ -18,47 +20,16 @@ jobs:
cp -r /tmp/deb-mock/* .
cp -r /tmp/deb-mock/.* . 2>/dev/null || true
- name: Install yamllint
run: |
sudo apt update
sudo apt install -y yamllint
- name: Lint YAML files
run: |
echo "=== Linting YAML files ==="
yamllint .forgejo/workflows/ deb_mock/configs/ test-config.yaml
echo "✅ YAML linting completed successfully"
python-lint:
name: Lint Python Code
runs-on: ubuntu-latest
steps:
- name: Checkout code
run: |
git clone https://git.raines.xyz/robojerk/deb-mock.git /tmp/deb-mock
cp -r /tmp/deb-mock/* .
cp -r /tmp/deb-mock/.* . 2>/dev/null || true
- name: Set up Python
run: |
sudo apt update
sudo apt install -y python3.12 python3.12-venv python3-pip
- name: Set up virtual environment
run: |
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
- name: Install Python linters
run: |
source venv/bin/activate
pip install flake8 black isort bandit
- name: Lint Python files
run: |
source venv/bin/activate
echo "=== Linting Python files ==="
source /opt/venv/bin/activate
echo "Running flake8..."
flake8 deb_mock/ tests/ --max-line-length=120 --ignore=E203,W503
echo "Running black check..."
@ -68,42 +39,12 @@ jobs:
echo "Running bandit security check..."
bandit -r deb_mock/ -f json -o bandit-report.json || true
echo "✅ Python linting completed successfully"
shell-lint:
name: Lint Shell Scripts
runs-on: ubuntu-latest
steps:
- name: Checkout code
run: |
git clone https://git.raines.xyz/robojerk/deb-mock.git /tmp/deb-mock
cp -r /tmp/deb-mock/* .
cp -r /tmp/deb-mock/.* . 2>/dev/null || true
- name: Install shellcheck
run: |
sudo apt update
sudo apt install -y shellcheck
- name: Lint shell scripts
run: |
echo "=== Linting shell scripts ==="
find . -name "*.sh" -exec shellcheck {} \;
echo "✅ Shell linting completed successfully"
debian-lint:
name: Lint Debian Files
runs-on: ubuntu-latest
steps:
- name: Checkout code
run: |
git clone https://git.raines.xyz/robojerk/deb-mock.git /tmp/deb-mock
cp -r /tmp/deb-mock/* .
cp -r /tmp/deb-mock/.* . 2>/dev/null || true
- name: Install Debian linting tools
run: |
sudo apt update
sudo apt install -y lintian devscripts
- name: Lint Debian files
run: |
@ -113,22 +54,6 @@ jobs:
echo "Checking debian/control..."
lintian --check debian/control || echo "Note: lintian check completed"
echo "✅ Debian linting completed successfully"
markdown-lint:
name: Lint Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
run: |
git clone https://git.raines.xyz/robojerk/deb-mock.git /tmp/deb-mock
cp -r /tmp/deb-mock/* .
cp -r /tmp/deb-mock/.* . 2>/dev/null || true
- name: Install markdownlint
run: |
sudo apt update
sudo apt install -y nodejs npm
sudo npm install -g markdownlint-cli
- name: Lint documentation
run: |