forked from kubeflow/kfp-tekton
-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (155 loc) · 4.91 KB
/
kfp-tekton-unittests.yml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: KFP Tekton Unit Tests
on:
push:
branches: [master]
# Run tests for any PRs.
pull_request:
env:
GITHUB_ACTION: "true"
SETUPTOOLS_USE_DISTUTILS: "stdlib"
jobs:
python-unittest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install -e sdk/python
- name: Unit Tests
run: VENV=$VIRTUAL_ENV make ci_unit_test
validate-testdata:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.19.x
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: python -m pip install -e sdk/python
- name: "Generate testdata yaml files."
run: VENV=$VIRTUAL_ENV make unit_test GENERATE_GOLDEN_YAML=True
- name: "Test only required noninled yaml files are generated."
run: make validate-generated-test-yamls
- name: "Tekton validation for testdata."
run: make validate-testdata
progress-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: python -m pip install -e sdk/python
- name: "Progress report on compiling KFP DSL test scripts"
run: VENV=$VIRTUAL_ENV make report PRINT_ERRORS="TRUE"
python-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: "Lint Python code with flake8"
run: VENV=$VIRTUAL_ENV make lint
check-license:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: "Verify source files contain the license header"
run: make check_license
check-mdtoc:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: "Verify Markdown files have current table of contents"
run: make check_mdtoc
check-doc-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Verify Markdown files have valid links"
run: make check_doc_links
run-go-unittests:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.19.x
- name: Checkout code
uses: actions/checkout@v2
- name: "run go unit tests"
run: make run-go-unittests
- name: "Verify apiserver, agent, and workflow build"
run: make build-backend
run-pipelineloop-unittests:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.19.x
- name: Checkout code
uses: actions/checkout@v2
- name: "run go pipelineLoop unit tests"
run: cd tekton-catalog/pipeline-loops && make test-all
backend-integration:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- id: changes
uses: jitterbit/get-changed-files@v1
with:
format: 'json'
- name: backend changes
id: backend-changes
run: |
readarray -t backend_files <<<"$(jq -r '.[]|select(startswith("backend") or startswith("go.mod"))|select(endswith("README.md")|not)' <<<'${{ steps.changes.outputs.all }}')"
echo "::set-output name=all::"
if [[ ${#backend_files[@]} -gt 0 ]]; then
if [[ -n "${backend_files[0]}" ]]; then
echo "::set-output name=all::yes"
fi
fi
- name: Create k8s Kind Cluster
if: ${{ steps.backend-changes.outputs.all }}
uses: container-tools/kind-action@v1
with:
cluster_name: kfp-tekton
kubectl_version: v1.24.7
version: v0.17.0
node_image: kindest/node:v1.24.7
- name: build images
if: ${{ steps.backend-changes.outputs.all }}
run: ./scripts/deploy/github/build-images.sh
- name: Set up Python 3.9
if: ${{ steps.backend-changes.outputs.all }}
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: "deploy kfp-tekton"
if: ${{ steps.backend-changes.outputs.all }}
run: ./scripts/deploy/github/deploy-kfp.sh
- name: Install sdk
if: ${{ steps.backend-changes.outputs.all }}
run: python -m pip install -e sdk/python
- name: "flip coin test"
if: ${{ steps.backend-changes.outputs.all }}
run: ./scripts/deploy/github/e2e-test.sh