mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
BE: github action better code check
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
24
.github/workflows/code_checks.yml
vendored
24
.github/workflows/code_checks.yml
vendored
@@ -21,7 +21,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "🔍 Checking for incorrect absolute '/php/' URLs (should be 'php/' or './php/')..."
|
echo "🔍 Checking for incorrect absolute '/php/' URLs (should be 'php/' or './php/')..."
|
||||||
|
|
||||||
MATCHES=$(grep -rE "['\"]\/php\/" --include=\*.{js,php,html} ./front | grep -E "\.get|\.post|\.ajax|fetch|url\s*:") || true
|
MATCHES=$(grep -rE "['\"]/php/" --include=\*.{js,php,html} ./front \
|
||||||
|
| grep -E "\.get|\.post|\.ajax|fetch|url\s*:") || true
|
||||||
|
|
||||||
if [ -n "$MATCHES" ]; then
|
if [ -n "$MATCHES" ]; then
|
||||||
echo "$MATCHES"
|
echo "$MATCHES"
|
||||||
@@ -85,25 +86,14 @@ jobs:
|
|||||||
echo "🔍 Linting Dockerfiles..."
|
echo "🔍 Linting Dockerfiles..."
|
||||||
/tmp/hadolint Dockerfile* || true
|
/tmp/hadolint Dockerfile* || true
|
||||||
|
|
||||||
test:
|
docker-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Run Docker-based tests
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
run: |
|
||||||
pip install -r requirements.txt
|
echo "🐳 Running Docker-based tests..."
|
||||||
pip install pytest pyyaml
|
chmod +x ./run_docker_tests.sh
|
||||||
|
./run_docker_tests.sh
|
||||||
- name: Run unit tests
|
|
||||||
run: |
|
|
||||||
echo "🧪 Running unit tests..."
|
|
||||||
export PYTHONPATH=$PYTHONPATH:./server
|
|
||||||
pytest -m "not (docker or compose or feature_complete)"
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user