diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml old mode 100755 new mode 100644 similarity index 100% rename from .github/ISSUE_TEMPLATE/feature_request.yml rename to .github/ISSUE_TEMPLATE/feature-request.yml diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code-checks.yml old mode 100755 new mode 100644 similarity index 100% rename from .github/workflows/code_checks.yml rename to .github/workflows/code-checks.yml diff --git a/.github/workflows/docker_cache-cleaner.yml b/.github/workflows/docker_cache-cleaner.yml deleted file mode 100755 index 43573815..00000000 --- a/.github/workflows/docker_cache-cleaner.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: 🤖Automation - ci-package-cleaner - -on: - - workflow_dispatch: # manual option - - # schedule: - # - cron: '15 22 * * 1' # every Monday 10.15pm UTC (~11.15am Tuesday NZT) - -jobs: - - package-cleaner: - name: package-cleaner - runs-on: ubuntu-latest - timeout-minutes: 5 - permissions: - packages: write - steps: - - - uses: actions/delete-package-versions@v4 - with: - package-name: netalertx - package-type: container - min-versions-to-keep: 0 - delete-only-untagged-versions: true \ No newline at end of file diff --git a/.github/workflows/docker_dev_unsafe.yml b/.github/workflows/docker_dev_unsafe.yml index 0caf8672..ad4db7b3 100644 --- a/.github/workflows/docker_dev_unsafe.yml +++ b/.github/workflows/docker_dev_unsafe.yml @@ -1,4 +1,4 @@ -name: docker-unsafe +name: docker-unsafe from next_release branch on: push: diff --git a/.github/workflows/run-all-tests.yml b/.github/workflows/run-all-tests.yml new file mode 100644 index 00000000..97091f71 --- /dev/null +++ b/.github/workflows/run-all-tests.yml @@ -0,0 +1,76 @@ +name: Manual Test Suite Selector + +on: + workflow_dispatch: + inputs: + run_unit_tests: + description: 'Core Logic Tests (Default)' + type: boolean + default: true + run_docker_tests: + description: 'Docker/Integration Tests' + type: boolean + default: false + run_feature_complete: + description: 'Feature Complete (E2E) Tests' + type: boolean + default: false + run_path_checks: + description: 'URL/Path Consistency Checks' + type: boolean + default: true + +jobs: + comprehensive-test: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Environment + run: sudo apt-get update && sudo apt-get install -y sqlite3 + + - name: Configure Test Command + id: config + run: | + # Build the pytest marker filter based on checkboxes + # Logic: Start by excluding everything, then add what was checked + MARKERS="" + + if [ "${{ github.event.inputs.run_unit_tests }}" == "true" ]; then + # This usually covers tests without specific markers + MARKERS="not (docker or compose or feature_complete)" + fi + + if [ "${{ github.event.inputs.run_docker_tests }}" == "true" ]; then + [ -n "$MARKERS" ] && MARKERS="$MARKERS or " + MARKERS="${MARKERS}docker or compose" + fi + + if [ "${{ github.event.inputs.run_feature_complete }}" == "true" ]; then + [ -n "$MARKERS" ] && MARKERS="$MARKERS or " + MARKERS="${MARKERS}feature_complete" + fi + + echo "final_markers=$MARKERS" >> $GITHUB_OUTPUT + + - name: Run Docker Integration Script + run: | + chmod +x ./test/docker_tests/run_docker_tests.sh + + # Inject the custom marker list into your script + # This replaces the hardcoded line in your run_docker_tests.sh + SED_COMMAND="pytest -m '${{ steps.config.outputs.final_markers }}'" + sed -i "s|pytest -m 'not (docker or compose or feature_complete)'|$SED_COMMAND|g" ./test/docker_tests/run_docker_tests.sh + + ./test/docker_tests/run_docker_tests.sh + + - name: Path Consistency Check + if: github.event.inputs.run_path_checks == 'true' + run: | + echo "🔍 Checking for incorrect absolute '/php/' URLs..." + MATCHES=$(grep -rE "['\"]/php/" --include=\*.{js,php,html} ./front | grep -E "\.get|\.post|\.ajax|fetch|url\s*:") || true + if [ -n "$MATCHES" ]; then + echo "$MATCHES" + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/social_post_on_release.yml b/.github/workflows/social-post-on-release.yml old mode 100755 new mode 100644 similarity index 100% rename from .github/workflows/social_post_on_release.yml rename to .github/workflows/social-post-on-release.yml