|
| 1 | +name: Tekton Integration |
| 2 | +# Adapted from https://github.com/mattmoor/mink/blob/master/.github/workflows/minkind.yaml |
| 3 | + |
| 4 | +on: [workflow_call] |
| 5 | + |
| 6 | +defaults: |
| 7 | + run: |
| 8 | + shell: bash |
| 9 | + |
| 10 | +jobs: |
| 11 | + e2e-tests: |
| 12 | + concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ matrix.k8s-name }}-${{ matrix.feature-flags }}-${{ github.event.pull_request.number || github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + name: e2e tests |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + fail-fast: false # Keep running if one leg fails. |
| 19 | + matrix: |
| 20 | + k8s-name: |
| 21 | + - k8s-oldest |
| 22 | + - k8s-plus-one |
| 23 | + |
| 24 | + include: |
| 25 | + - k8s-name: k8s-oldest |
| 26 | + k8s-version: v1.28.x |
| 27 | + - k8s-name: k8s-plus-one |
| 28 | + k8s-version: v1.29.x |
| 29 | + env: |
| 30 | + KO_DOCKER_REPO: registry.local:5000/tekton |
| 31 | + CLUSTER_DOMAIN: c${{ github.run_id }}.local |
| 32 | + ARTIFACTS: ${{ github.workspace }}/artifacts |
| 33 | + |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 36 | + - uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 |
| 37 | + with: |
| 38 | + go-version-file: "go.mod" |
| 39 | + - uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 |
| 40 | + |
| 41 | + - name: Install Dependencies |
| 42 | + working-directory: ./ |
| 43 | + run: | |
| 44 | + echo '::group:: install go-junit-report' |
| 45 | + go install github.com/jstemmer/go-junit-report@v0.9.1 |
| 46 | + echo '::endgroup::' |
| 47 | +
|
| 48 | + echo '::group:: created required folders' |
| 49 | + mkdir -p "${ARTIFACTS}" |
| 50 | + echo '::endgroup::' |
| 51 | +
|
| 52 | + echo '::group:: fetch setup-kind.sh from plumbing' |
| 53 | + curl -sL https://raw.githubusercontent.com/tektoncd/plumbing/main/tekton/images/kind-e2e/setup-kind.sh \ |
| 54 | + -o ./hack/setup-kind.sh |
| 55 | + chmod +x ./hack/setup-kind.sh |
| 56 | + echo '::endgroup::' |
| 57 | +
|
| 58 | + echo "${GOPATH}/bin" >> "$GITHUB_PATH" |
| 59 | +
|
| 60 | + - name: Run tests |
| 61 | + run: | |
| 62 | + ./hack/setup-kind.sh \ |
| 63 | + --registry-url $(echo ${KO_DOCKER_REPO} | cut -d'/' -f 1) \ |
| 64 | + --cluster-suffix c${{ github.run_id }}.local \ |
| 65 | + --nodes 3 \ |
| 66 | + --k8s-version ${{ matrix.k8s-version }} \ |
| 67 | + --e2e-script ./test/e2e-tests.sh \ |
| 68 | + --e2e-env ./test/e2e-tests-kind-prow.env |
| 69 | +
|
| 70 | + - name: Upload test results |
| 71 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 72 | + with: |
| 73 | + name: ${{ matrix.k8s-version }}-${{ matrix.feature-flags }} |
| 74 | + path: ${{ env.ARTIFACTS }} |
| 75 | + |
| 76 | + - uses: chainguard-dev/actions/kind-diag@4ed96e952ef2982fe89a50f3c40e9643bb9fe803 # v1.6.3 |
| 77 | + if: ${{ failure() }} |
| 78 | + with: |
| 79 | + artifact-name: ${{ matrix.k8s-version }}-${{ matrix.feature-flags }}-logs |
| 80 | + |
| 81 | + - name: Dump Artifacts |
| 82 | + if: ${{ failure() }} |
| 83 | + run: | |
| 84 | + if [[ -d ${{ env.ARTIFACTS }} ]]; then |
| 85 | + cd ${{ env.ARTIFACTS }} |
| 86 | + for x in $(find . -type f); do |
| 87 | + echo "::group:: artifact $x" |
| 88 | + cat $x |
| 89 | + echo '::endgroup::' |
| 90 | + done |
| 91 | + fi |
0 commit comments