Skip to content

Commit

Permalink
WIP - Run e2e tests in GHA
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Frittoli <[email protected]>
  • Loading branch information
afrittoli committed Dec 4, 2024
1 parent 1dd488e commit 13116f7
Show file tree
Hide file tree
Showing 3 changed files with 411 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/e2e-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Tekton Integration
# Adapted from https://github.com/mattmoor/mink/blob/master/.github/workflows/minkind.yaml

on:
pull_request:
branches: [ main ]

defaults:
run:
shell: bash
# working-directory: ./src/github.com/mattmoor/mink

jobs:
e2e-tests:
name: e2e tests
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.29.x

feature-flags:
- prow
- prow-beta
- prow-alpha
- prow-feature-flags

env:
GOPATH: ${{ github.workspace }}
GO111MODULE: on
GOFLAGS: -ldflags=-s -ldflags=-w -mod=vendor -tags=nostackdriver
KO_DOCKER_REPO: registry.local:5000/tekton
CLUSTER_DOMAIN: c${{ github.run_id }}.local

# Tekton tests rely on this.
CONFIG_FEATURE_FLAGS_NAME: config-features
ARTIFACTS: ${{ github.workspace }}/artifacts

steps:
- name: Check out code onto GOPATH
uses: actions/checkout@v4

- name: Set up Go 1.22
uses: actions/setup-go@v5
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::'
- name: Run tests
run: |
./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.sh \
--e2e-env ./test/e2e-tests-kind-${{ matrix.feature-flags }}.env
- uses: chainguard-dev/actions/kind-diag@main
if: ${{ failure() }}

- name: Dump Artifacts
if: ${{ failure() }}
run: |
if [[ -d ${{ env.ARTIFACTS }} ]]; then
cd ${{ env.ARTIFACTS }}
for x in $(find . -type f); do
echo "::group:: artifact $x"
cat $x
echo '::endgroup::'
done
fi
Loading

0 comments on commit 13116f7

Please sign in to comment.