-
Notifications
You must be signed in to change notification settings - Fork 58
89 lines (86 loc) · 2.8 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
84
85
86
87
88
89
---
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: "3"
- name: Show changed dirs
run: |
echo ${{ steps.changed-dirs.outputs.all_changed_files }}
- name: Create k8s Kind Cluster
uses: helm/[email protected]
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
timeout-minutes: 10
if: |
steps.changed-dirs.outputs.any_changed == 'true'
run: |
.github/scripts/deploy_registry.sh
- 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
- name: Install tkn
if: |
steps.changed-dirs.outputs.any_changed == 'true'
uses: ./.github/actions/install-tkn
- name: Prepare docker config json
run: |
authString=$(echo -n "root:root" | base64 -w0)
cat > "/tmp/.dockerconfig.json" << EOF
{
"auths": {
"registry-service.kind-registry": {
"auth": "${authString}"
}
}
}
EOF
cat "/tmp/.dockerconfig.json"
- name: Test Tekton tasks
if: |
steps.changed-dirs.outputs.any_changed == 'true'
run: .github/scripts/test_tekton_tasks.sh
env:
TRUSTED_ARTIFACT_OCI_DOCKER_CONFIG_JSON_PATH: /tmp/.dockerconfig.json
TRUSTED_ARTIFACT_OCI_STORAGE: "registry-service.kind-registry/trusted-artifacts"
TEST_ITEMS: >-
${{ steps.changed-dirs.outputs.all_changed_files }}