mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-06 17:15:38 -08:00
CI Checks
Uses the new run_docker_tests.sh script which is self-contained and handles all dependencies and test execution within a Docker container. This ensures that the CI environment is consistent with the local devcontainer environment. Fixes an issue where the job name 'test' was considered invalid. Renamed to 'docker-tests'. Ensures that tests marked as 'feature_complete' are also excluded from the test run.
This commit is contained in:
23
.github/workflows/code_checks.yml
vendored
23
.github/workflows/code_checks.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
run: |
|
||||
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
|
||||
echo "$MATCHES"
|
||||
@@ -85,25 +85,14 @@ jobs:
|
||||
echo "🔍 Linting Dockerfiles..."
|
||||
/tmp/hadolint Dockerfile* || true
|
||||
|
||||
test:
|
||||
docker-tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install dependencies
|
||||
- name: Run Docker-based tests
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
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)"
|
||||
|
||||
echo "🐳 Running Docker-based tests..."
|
||||
chmod +x ./run_docker_tests.sh
|
||||
./run_docker_tests.sh
|
||||
Reference in New Issue
Block a user