-
Notifications
You must be signed in to change notification settings - Fork 268
170 lines (140 loc) · 5.26 KB
/
ci.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
160
161
162
163
164
165
166
167
168
169
170
name: Tekton CI
permissions:
contents: read
on:
pull_request:
branches: ["main"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
name: Build tests
runs-on: ubuntu-24.04
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: ''
steps:
- name: Harden runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: ${{ github.workspace }}/src/github.com/tektoncd/dashboard
- name: Set up Go 1.22
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: 1.22.5
- name: Install dependencies
run: |
echo "${GOPATH}/bin" >> "$GITHUB_PATH"
GO111MODULE="on" go install github.com/google/[email protected]
# Install GolangCI linter: https://github.com/golangci/golangci-lint/
GOLANGCI_VERSION=1.62.2
curl -sL https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-amd64.tar.gz | tar -C /usr/local/bin -xvzf - --strip-components=1 --wildcards "*/golangci-lint"
- name: Run tests
working-directory: ${{ github.workspace }}/src/github.com/tektoncd/dashboard
run: |
./test/presubmit-tests.sh --build-tests
unit-tests:
name: Unit tests
runs-on: ubuntu-24.04
steps:
- name: Harden runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run tests
run: |
./test/presubmit-tests.sh --unit-tests
e2e-tests:
name: E2E tests
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
k8s-name:
- k8s-oldest
- k8s-plus-one
dashboard-mode:
- read-only
- read-write
# k8s-name above is used to give stable naming of the checks for branch
# protection config. Map name to corresponding version for use in steps
include:
- k8s-name: k8s-oldest
k8s-version: v1.29.x
- k8s-name: k8s-plus-one
k8s-version: v1.30.x
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: on
KO_DOCKER_REPO: registry.local:5000/tekton
CLUSTER_DOMAIN: c${{ github.run_id }}.local
ARTIFACTS: ${{ github.workspace }}/artifacts
steps:
- name: Harden runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: ${{ github.workspace }}/src/github.com/tektoncd/dashboard
- name: Checkout setup-kind.sh
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: tektoncd/pipeline
ref: d306d649df2dbd2badaba6a90459efd05c753d2f
path: scripts
sparse-checkout: |
hack/setup-kind.sh
sparse-checkout-cone-mode: false
- name: Set up Go 1.22
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: 1.22.5
- name: Install dependencies
working-directory: ./
run: |
echo '::group::install ko'
curl -L https://github.com/ko-build/ko/releases/download/v0.15.4/ko_0.15.4_Linux_x86_64.tar.gz | tar xzf - ko
chmod +x ./ko
sudo mv ko /usr/local/bin
echo '::endgroup::'
echo '::group::create required folders'
mkdir -p "${ARTIFACTS}"
echo '::endgroup::'
echo "${GOPATH}/bin" >> "$GITHUB_PATH"
- name: Run tests
working-directory: ${{ github.workspace }}/src/github.com/tektoncd/dashboard
env:
DASHBOARD_MODE: ${{ matrix.dashboard-mode }}
run: |
${{ github.workspace }}/scripts/hack/setup-kind.sh \
--registry-url $(echo ${KO_DOCKER_REPO} | cut -d'/' -f 1) \
--cluster-suffix c${{ github.run_id }}.local \
--nodes 3 \
--k8s-version ${{ matrix.k8s-version }} \
--e2e-script ./test/e2e-tests-prow.sh \
--e2e-env ./test/e2e-tests-kind-prow.env
- name: Upload test results
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
if: ${{ failure() }}
with:
name: ${{ matrix.k8s-version }}-${{ matrix.dashboard-mode }}
path: ${{ env.ARTIFACTS }}
# - name: Collect resources from cluster
# uses: chainguard-dev/actions/kind-diag@94389dc7faf4ef9040df90498419535e1bdcb60e # main
# if: ${{ failure() }}
# with:
# artifact-name: ${{ matrix.k8s-version }}-${{ matrix.dashboard-mode }}-logs
# namespace-resources: pods,taskruns,pipelineruns