30 lines
1.6 KiB
YAML
30 lines
1.6 KiB
YAML
name: Runner probe
|
|
|
|
on:
|
|
push:
|
|
branches: [ probe-runner-tools ]
|
|
|
|
jobs:
|
|
probe:
|
|
permissions:
|
|
contents: read
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install the quality tools from PyPI and run them on bad files
|
|
run: |
|
|
python3 -m venv /tmp/qc
|
|
/tmp/qc/bin/pip install --quiet ruff==0.6.9 mypy==1.11.2 shellcheck-py==0.10.0.1 shfmt-py==3.11.0.2 > /tmp/pip.log 2>&1 || { tail -n 5 /tmp/pip.log; exit 1; }
|
|
for tool in ruff mypy shellcheck shfmt; do
|
|
echo "PROBE version $tool: $(/tmp/qc/bin/$tool --version 2>&1 | head -n 2 | tr '\n' ' ')"
|
|
done
|
|
printf '#!/usr/bin/env bash\necho $1\n' > /tmp/bad.sh
|
|
printf 'import os\nx=1\n' > /tmp/bad.py
|
|
printf 'def f(a):\n return a\n' > /tmp/untyped.py
|
|
set +e
|
|
/tmp/qc/bin/shellcheck /tmp/bad.sh > /tmp/o1 2>&1; echo "PROBE shellcheck bad.sh exit=$? first: $(head -n 2 /tmp/o1 | tr '\n' ' ')"
|
|
/tmp/qc/bin/ruff check /tmp/bad.py > /tmp/o2 2>&1; echo "PROBE ruff check bad.py exit=$? first: $(head -n 2 /tmp/o2 | tr '\n' ' ')"
|
|
/tmp/qc/bin/ruff format --check /tmp/bad.py > /tmp/o3 2>&1; echo "PROBE ruff format --check exit=$? first: $(head -n 1 /tmp/o3)"
|
|
/tmp/qc/bin/mypy --strict /tmp/untyped.py > /tmp/o4 2>&1; echo "PROBE mypy --strict exit=$? first: $(head -n 1 /tmp/o4)"
|
|
/tmp/qc/bin/shfmt -d /tmp/bad.sh > /tmp/o5 2>&1; echo "PROBE shfmt -d exit=$? first: $(head -n 1 /tmp/o5)"
|
|
/tmp/qc/bin/shellcheck /dev/null > /dev/null 2>&1; echo "PROBE shellcheck on an empty file exit=$?"
|