[Tests] Basic Acceptance Tests #7801
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # SPDX-FileCopyrightText: (C) 2025-2026 Intel Corporation | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: "[Tests] Basic Acceptance Tests" | |
| run-name: "[Tests] Basic Acceptance Tests" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| cleanup: | |
| description: "Cleanup before running BAT tests" | |
| required: false | |
| default: false | |
| type: boolean | |
| timeout: | |
| description: "Timeout for the job in minutes" | |
| required: false | |
| type: number | |
| default: 60 | |
| pull_request: | |
| branches: | |
| - main | |
| - release-* | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - ready_for_review | |
| push: | |
| branches: | |
| - main | |
| - release-* | |
| # Trigger workflow when enqueued to a merge group | |
| # (must be under 'on') | |
| merge_group: {} | |
| # Only run at most 1 workflow concurrently per PR or per branch to keep costs down | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| SUPASS: demo | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-pr-state: | |
| name: "Check PR State" | |
| runs-on: ubuntu-latest | |
| outputs: | |
| pr_state: ${{ steps.check_pr.outputs.pr_state }} | |
| steps: | |
| - name: "Return success if triggered manually" | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| run: | | |
| echo "Triggered manually." | |
| exit 0 | |
| - name: Checkout code | |
| if: ${{ github.event_name == 'pull_request' }} | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: "Set up GitHub CLI" | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: | | |
| sudo apt-get update && sudo apt-get install gh | |
| - name: "Check PR state" | |
| id: check_pr | |
| if: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| PR_NUMBER=${{ github.event.number }} | |
| PR_STATE=$(gh pr view $PR_NUMBER --json isDraft --jq '.isDraft') | |
| echo "pr_state=$PR_STATE" >> $GITHUB_OUTPUT | |
| echo "PR State \"isDraft\": $PR_STATE" | |
| filter: | |
| name: "Filter Changed Code Paths" | |
| needs: check-pr-state | |
| runs-on: ubuntu-latest | |
| if: ${{ needs.check-pr-state.outputs.pr_state != 'true' || github.event_name == 'workflow_dispatch' }} | |
| outputs: | |
| code_changed: ${{ steps.filter.outputs.code }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set paths filter | |
| id: filter | |
| uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| with: | |
| predicate-quantifier: "every" | |
| filters: | | |
| code: | |
| - '!**/*.md' | |
| - '!**/*.rst' | |
| - '!**/*.html' | |
| - '!**/*.license' | |
| - '!**/*.svg' | |
| - '!**/*.png' | |
| - '!**/*.jpeg' | |
| - '!**/*.jpg' | |
| - '!**/*.JPG' | |
| - '!**/*.ico' | |
| - '!**/*.pdf' | |
| - '!LICENSES/**' | |
| - '!docs/**' | |
| run-basic-acceptance-tests: | |
| name: "Run Basic Acceptance Tests" | |
| runs-on: [bat] | |
| permissions: | |
| packages: write # For using GHCR as cache registry | |
| timeout-minutes: ${{ fromJSON(inputs.timeout || '60') }} | |
| needs: [filter, check-pr-state] | |
| if: ${{ needs.filter.outputs.code_changed == 'true' && (needs.check-pr-state.outputs.pr_state != 'true' || github.event_name == 'workflow_dispatch') }} | |
| steps: | |
| - name: "Checkout Repository" | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: "Remove all Docker images" | |
| if: ${{ github.event.inputs.cleanup == 'true' }} | |
| uses: ./.github/actions/cleanup | |
| with: | |
| system-prune: "true" | |
| - name: "Log in to GHCR" | |
| uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: "Setup Cache Targets" | |
| id: setup-cache | |
| uses: ./.github/actions/setup-cache | |
| - name: "Run Basic Acceptance Tests (BAT)" | |
| env: | |
| CACHE_REGISTRY: ${{ steps.setup-cache.outputs.cache_registry }} | |
| CACHE_TAG: ${{ steps.setup-cache.outputs.cache_tag }} | |
| GITHUB_ACTIONS_CACHE: ${{ steps.setup-cache.outputs.github_actions_cache }} | |
| run: | | |
| make clean-all | |
| git clean -fdx | |
| make run_basic_acceptance_tests | |
| - name: Upload Logs and Reports | |
| if: always() | |
| uses: ./.github/actions/upload-artifacts | |
| - name: Cleanup | |
| if: always() | |
| uses: ./.github/actions/cleanup | |
| chart-deployment-test: | |
| name: "Chart Deployment Test" | |
| runs-on: [bat] | |
| permissions: | |
| packages: write # For using GHCR as cache registry | |
| needs: [filter, check-pr-state] | |
| if: ${{ needs.filter.outputs.code_changed == 'true' && (needs.check-pr-state.outputs.pr_state != 'true' || github.event_name == 'workflow_dispatch') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.x" | |
| check-latest: true | |
| - name: "Log in to GHCR" | |
| uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: "Setup Cache Targets" | |
| id: setup-cache | |
| uses: ./.github/actions/setup-cache | |
| - name: Install chart with timeout | |
| env: | |
| CACHE_REGISTRY: ${{ steps.setup-cache.outputs.cache_registry }} | |
| CACHE_TAG: ${{ steps.setup-cache.outputs.cache_tag }} | |
| GITHUB_ACTIONS_CACHE: ${{ steps.setup-cache.outputs.github_actions_cache }} | |
| run: | | |
| KUBERNETES=1 DEPLOYMENT_TEST=1 ./deploy.sh | |
| - name: Stability test (2m) | |
| run: make -C kubernetes test | |
| - name: Fetch stability test logs | |
| if: always() | |
| run: kubectl logs -n scenescape scenescape-release-1-test-stability || true | |
| - name: Print all pods | |
| if: always() | |
| run: kubectl get pods,deployments,services -n scenescape -o wide | |
| - name: Print all logs | |
| if: always() | |
| run: | | |
| kubectl get pods -n scenescape -o name | xargs -r -n1 -I{} sh -c 'echo "===== {} ====="; kubectl logs -n '"$NAMESPACE"' {} --all-containers --tail=500 || true' | |
| - name: Cleanup | |
| if: always() | |
| uses: ./.github/actions/cleanup |