feat(EC-1868): use conforma/tekton-catalog for verify-conforma task #19613
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
| --- | |
| name: Tekton Task Tests | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| merge_group: | |
| types: [checks_requested] | |
| jobs: | |
| run-tekton-task-tests: | |
| name: Run Tekton Task tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Get changed dirs | |
| id: changed-dirs | |
| uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 | |
| with: | |
| files: | | |
| tasks/*/** | |
| files_ignore: | | |
| **/*.md | |
| dir_names: "true" | |
| dir_names_max_depth: "3" | |
| - name: Show changed dirs | |
| id: show-changed-dirs | |
| shell: bash | |
| run: | | |
| echo ${{ steps.changed-dirs.outputs.all_changed_files }} | |
| trustedArtifactsBasedTasks=() | |
| pvcBasedTasks=() | |
| for dir in ${{ steps.changed-dirs.outputs.all_changed_files }} | |
| do | |
| echo "$dir" | |
| taskName=$(basename "${dir}") | |
| taskFile="${dir}/${taskName}.yaml" | |
| if [ -f "${taskFile}" ] \ | |
| && grep -q "name: use-trusted-artifact\|name: create-trusted-artifact" "${taskFile}" | |
| then | |
| echo "Found a trusted artifacts compatible task: ${taskFile}" | |
| trustedArtifactsBasedTasks+=($dir) | |
| else | |
| echo "Found a legacy PVC-based task: ${taskFile}" | |
| pvcBasedTasks+=($dir) | |
| fi | |
| done | |
| echo "trustedArtifactsBasedTasks: ${trustedArtifactsBasedTasks[@]}" | |
| echo "trustedArtifactsBasedTasks=${trustedArtifactsBasedTasks[@]}" >> $GITHUB_OUTPUT | |
| echo "pvcBasedTasks: ${pvcBasedTasks[@]}" | |
| echo "pvcBasedTasks=${pvcBasedTasks[@]}" >> $GITHUB_OUTPUT | |
| - name: Create k8s Kind Cluster | |
| uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0 | |
| if: | | |
| steps.changed-dirs.outputs.any_changed == 'true' | |
| - name: Check cluster info | |
| if: | | |
| steps.changed-dirs.outputs.any_changed == 'true' | |
| run: | | |
| kubectl cluster-info | |
| - name: Deploy Local Kind Registry | |
| id: deploy-local-kind-registry | |
| timeout-minutes: 10 | |
| if: | | |
| steps.changed-dirs.outputs.any_changed == 'true' | |
| run: | | |
| . .github/scripts/deploy_registry.sh | |
| echo "DOCKER_CONFIG_JSON=${DOCKER_CONFIG_JSON}" >> "$GITHUB_OUTPUT" | |
| - name: Install Tekton | |
| timeout-minutes: 10 | |
| if: | | |
| steps.changed-dirs.outputs.any_changed == 'true' | |
| run: | | |
| kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml | |
| echo -n Waiting for Tekton pods to appear.. | |
| while [ $(kubectl get pods --namespace tekton-pipelines -o name | wc -l) -lt 2 ] | |
| do | |
| sleep 1 | |
| echo -n . | |
| done | |
| echo " done" | |
| echo Waiting for Tekton pods to be ready | |
| for POD in $(kubectl get pods --namespace tekton-pipelines -o name) | |
| do | |
| kubectl wait --timeout=120s --for=condition=Ready $POD --namespace tekton-pipelines | |
| done | |
| kubectl get pods --namespace tekton-pipelines | |
| # let tekton controllers startup... | |
| sleep 10 | |
| # enable stepActions | |
| echo "Updating feature-flags" | |
| kubectl get cm feature-flags -n tekton-pipelines -o yaml | \ | |
| sed -e 's|enable-step-actions: "false"|enable-step-actions: "true"|' > /tmp/ff.yaml | |
| kubectl apply -f /tmp/ff.yaml -n tekton-pipelines | |
| - name: Install tkn | |
| if: | | |
| steps.changed-dirs.outputs.any_changed == 'true' | |
| uses: ./.github/actions/install-tkn | |
| - name: Test Tekton tasks with Trusted Artifacts | |
| if: | | |
| steps.show-changed-dirs.outputs.trustedArtifactsBasedTasks != '' | |
| run: .github/scripts/test_tekton_tasks.sh | |
| env: | |
| DOCKER_CONFIG_JSON: ${{ steps.deploy-local-kind-registry.outputs.DOCKER_CONFIG_JSON }} | |
| USE_TRUSTED_ARTIFACTS: true | |
| TEST_ITEMS: >- | |
| ${{ steps.show-changed-dirs.outputs.trustedArtifactsBasedTasks }} | |
| - name: Test Tekton tasks using PVC-based workspace | |
| if: | | |
| steps.show-changed-dirs.outputs.pvcBasedTasks != '' | |
| run: .github/scripts/test_tekton_tasks.sh | |
| env: | |
| TEST_ITEMS: >- | |
| ${{ steps.show-changed-dirs.outputs.pvcBasedTasks }} |