forked from konflux-ci/release-service-catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (80 loc) · 2.79 KB
/
tekton_task_tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
name: Tekton Task Tests
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
run-tekton-task-tests:
name: Run Tekton Task tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed dirs
id: changed-dirs
uses: tj-actions/changed-files@v41
with:
files: |
tasks/**
dir_names: "true"
dir_names_max_depth: "2"
- name: Get internal changed dirs
id: changed-internal-dirs
uses: tj-actions/changed-files@v41
with:
files: |
internal/tasks/**
dir_names: "true"
dir_names_max_depth: "3"
- name: Show changed dirs
run: |
echo ${{ steps.changed-dirs.outputs.all_changed_files }} \
${{ steps.changed-internal-dirs.outputs.all_changed_files }}
- name: Create k8s Kind Cluster
uses: helm/[email protected]
if: |
steps.changed-dirs.outputs.any_changed == 'true' ||
steps.changed-internal-dirs.outputs.any_changed == 'true'
- name: Check cluster info
if: |
steps.changed-dirs.outputs.any_changed == 'true' ||
steps.changed-internal-dirs.outputs.any_changed == 'true'
run: |
kubectl cluster-info
- name: Install Tekton
timeout-minutes: 10
if: |
steps.changed-dirs.outputs.any_changed == 'true' ||
steps.changed-internal-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
- name: Install tkn
if: |
steps.changed-dirs.outputs.any_changed == 'true' ||
steps.changed-internal-dirs.outputs.any_changed == 'true'
uses: ./.github/actions/install-tkn
- name: Test Tekton tasks
if: |
steps.changed-dirs.outputs.any_changed == 'true' ||
steps.changed-internal-dirs.outputs.any_changed == 'true'
run: .github/scripts/test_tekton_tasks.sh
env:
TEST_ITEMS: >-
${{ steps.changed-dirs.outputs.all_changed_files }}
${{ steps.changed-internal-dirs.outputs.all_changed_files }}