CLOUDDST-32791: Add fbc-inject-lifecycle to FBC pipeline #17314
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
| # yamllint disable-file | |
| # <TEMPLATED FILE!> | |
| # This file comes from the templates at https://github.com/konflux-ci/task-repo-shared-ci. | |
| # Please consider sending a PR upstream instead of editing the file directly. | |
| # See the SHARED-CI.md document in this repo for more details. | |
| name: Run Task Tests | |
| "on": | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| merge_group: | |
| types: [checks_requested] | |
| jobs: | |
| run-task-tests: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout this Repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| ref: "${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}" | |
| path: self | |
| - name: Get all changed files in the PR from task directory | |
| id: changed-task-dirs | |
| uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0 | |
| with: | |
| files: | | |
| # Any task yaml or script (including its tests) is changed | |
| task/**/*.{yaml,sh} | |
| dir_names: "true" | |
| path: self | |
| - name: Check if tests dir exists for all the tasks changed | |
| if: steps.changed-task-dirs.outputs.any_changed == 'true' | |
| id: tasks-to-be-tested | |
| env: | |
| CHANGED_DIRS: ${{ steps.changed-task-dirs.outputs.all_changed_files }} | |
| run: | | |
| echo "Task Dirs changed in PR: ${CHANGED_DIRS}" | |
| # Check if tests dir exists under each task dir | |
| TASKS_TO_BE_TESTED=() | |
| for TASK_DIR in ${CHANGED_DIRS}; do | |
| TESTS_DIR=self/${TASK_DIR}/tests | |
| if [ ! -d $TESTS_DIR ]; then | |
| echo "INFO: tests dir does not exist: $TESTS_DIR" | |
| continue | |
| else | |
| echo "INFO: tests dir exists for task: $TASK_DIR" | |
| TASKS_TO_BE_TESTED+=("$TASK_DIR") | |
| fi | |
| done | |
| echo "Tasks with tests: ${TASKS_TO_BE_TESTED[*]}" | |
| echo "tasklist=${TASKS_TO_BE_TESTED[*]}" >> $GITHUB_OUTPUT | |
| - name: Install tkn | |
| if: steps.changed-task-dirs.outputs.any_changed == 'true' | |
| uses: ./self/.github/actions/install-tkn | |
| - name: Checkout konflux-ci/konflux-ci Repository | |
| if: steps.changed-task-dirs.outputs.any_changed == 'true' | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| repository: 'konflux-ci/konflux-ci' | |
| path: konflux-ci | |
| ref: 3a694f8d7b49e74f476bb9414fc3e6d03d50ae37 | |
| - name: Create k8s Kind Cluster | |
| if: steps.changed-task-dirs.outputs.any_changed == 'true' | |
| uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0 | |
| with: | |
| config: konflux-ci/kind-config.yaml | |
| - name: Show version information | |
| if: steps.changed-task-dirs.outputs.any_changed == 'true' | |
| run: | | |
| kubectl version | |
| kind version | |
| - name: Deploying Dependencies | |
| if: steps.changed-task-dirs.outputs.any_changed == 'true' | |
| run: | | |
| cd $GITHUB_WORKSPACE/konflux-ci | |
| ./deploy-deps.sh | |
| - name: Wait for the dependencies to be ready | |
| if: steps.changed-task-dirs.outputs.any_changed == 'true' | |
| run: | | |
| cd $GITHUB_WORKSPACE/konflux-ci | |
| ./wait-for-all.sh | |
| - name: Validate Tekton Tasks Syntax | |
| if: steps.changed-task-dirs.outputs.any_changed == 'true' | |
| run: | | |
| cd self | |
| ./.github/scripts/check_task_and_pipeline_yamls.sh ${{ steps.changed-task-dirs.outputs.all_changed_files }} | |
| - name: Deploying Konflux | |
| if: steps.tasks-to-be-tested.outputs.tasklist != '' | |
| run: | | |
| cd $GITHUB_WORKSPACE/konflux-ci | |
| ./deploy-konflux.sh | |
| - name: List namespaces | |
| if: steps.tasks-to-be-tested.outputs.tasklist != '' | |
| run: | | |
| kubectl get namespace | |
| - name: Deploy test resources | |
| if: steps.tasks-to-be-tested.outputs.tasklist != '' | |
| run: | | |
| cd $GITHUB_WORKSPACE/konflux-ci | |
| ./deploy-test-resources.sh | |
| - name: Run the task tests | |
| if: steps.tasks-to-be-tested.outputs.tasklist != '' | |
| env: | |
| TASK_LIST: ${{ steps.tasks-to-be-tested.outputs.tasklist }} | |
| run: | | |
| echo "Tasks to be tested: ${TASK_LIST}" | |
| cd $GITHUB_WORKSPACE/self | |
| ./.github/scripts/test_tekton_tasks.sh ${TASK_LIST} |