Skip to content

Commit f702e0a

Browse files
afrittolitekton-robot
authored andcommitted
Run e2e tests in GHA
Setup a matrix that runs all current integration jobs in GitHub actions. Re-use the setup-kind.sh script from the plumbing repo that is used today to run these jobs in prow, so that virtually no change to the jobs is needed. Once this is in and proven stable, the kind part can be turned into a reusable action step, hosted in the plumbing repo, that all Tekton projects may use. Signed-off-by: Andrea Frittoli <[email protected]>
1 parent ed1b64e commit f702e0a

File tree

4 files changed

+433
-1
lines changed

4 files changed

+433
-1
lines changed

.github/workflows/e2e-matrix.yml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Tekton Integration
2+
# Adapted from https://github.com/mattmoor/mink/blob/master/.github/workflows/minkind.yaml
3+
4+
on:
5+
pull_request:
6+
branches: [ main ]
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
jobs:
13+
e2e-tests:
14+
name: e2e tests
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false # Keep running if one leg fails.
18+
matrix:
19+
k8s-version:
20+
- v1.28.x
21+
- v1.29.x
22+
23+
feature-flags:
24+
- prow
25+
- prow-beta
26+
- prow-alpha
27+
# - prow-feature-flags - this is tested today as a periodic job, but we could integrate it here
28+
29+
env:
30+
GOPATH: ${{ github.workspace }}
31+
GO111MODULE: on
32+
KO_DOCKER_REPO: registry.local:5000/tekton
33+
CLUSTER_DOMAIN: c${{ github.run_id }}.local
34+
ARTIFACTS: ${{ github.workspace }}/artifacts
35+
36+
steps:
37+
- name: Check out code onto GOPATH
38+
uses: actions/checkout@v4
39+
with:
40+
path: ${{ github.workspace }}/src/github.com/tektoncd/pipeline
41+
42+
43+
- name: Set up Go 1.22
44+
uses: actions/setup-go@v5
45+
with:
46+
go-version: 1.22.5
47+
48+
- name: Install Dependencies
49+
working-directory: ./
50+
run: |
51+
echo '::group:: install ko'
52+
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
53+
chmod +x ./ko
54+
sudo mv ko /usr/local/bin
55+
echo '::endgroup::'
56+
57+
echo '::group:: install go-junit-report'
58+
go install github.com/jstemmer/[email protected]
59+
echo '::endgroup::'
60+
61+
echo '::group:: created required folders'
62+
mkdir -p "${ARTIFACTS}"
63+
echo '::endgroup::'
64+
65+
echo "${GOPATH}/bin" >> "$GITHUB_PATH"
66+
67+
- name: Run tests
68+
working-directory: ${{ github.workspace }}/src/github.com/tektoncd/pipeline
69+
run: |
70+
./hack/setup-kind.sh \
71+
--registry-url $(echo ${KO_DOCKER_REPO} | cut -d'/' -f 1) \
72+
--cluster-suffix c${{ github.run_id }}.local \
73+
--nodes 3 \
74+
--k8s-version ${{ matrix.k8s-version }} \
75+
--e2e-script ./test/e2e-tests.sh \
76+
--e2e-env ./test/e2e-tests-kind-${{ matrix.feature-flags }}.env
77+
78+
- name: Upload test results
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: ${{ matrix.k8s-version }}-${{ matrix.feature-flags }}
82+
path: ${{ env.ARTIFACTS }}
83+
84+
- uses: chainguard-dev/actions/kind-diag@main
85+
if: ${{ failure() }}
86+
with:
87+
artifact-name: ${{ matrix.k8s-version }}-${{ matrix.feature-flags }}-logs
88+
89+
- name: Dump Artifacts
90+
if: ${{ failure() }}
91+
run: |
92+
if [[ -d ${{ env.ARTIFACTS }} ]]; then
93+
cd ${{ env.ARTIFACTS }}
94+
for x in $(find . -type f); do
95+
echo "::group:: artifact $x"
96+
cat $x
97+
echo '::endgroup::'
98+
done
99+
fi

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,7 @@ test/pullrequest/pullrequest-init
6262
docs/pipeline-api.md.backup
6363

6464
# Ignore .env files
65-
/.env
65+
/.env
66+
67+
# Ignore generated kind.yaml
68+
kind.yaml

0 commit comments

Comments
 (0)