Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 160 additions & 0 deletions .github/workflows/e2e-matrix-extras.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: Tekton Integration (Backcompat)

on:
issue_comment:
types: [created, edited]

permissions:
contents: read
pull-requests: read
checks: write

defaults:
run:
shell: bash

jobs:
run-if-requested:
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/run-extra-tests') }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a bit more efficient than slash command as it doesn't require to run a workflow if the comment doesn't contain /run-extra-tests

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this circumvent rules regarding who can run/trigger tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should stick to one way of implementing slash commands.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could use a slash command to add a label, and check for the label in matrix - only run certain instances if the label is set.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the only reason I did not go with slash command was, aside from experimenting, that this approach doesn't consume "run" — aka it won't start a workflow unless the comment on the PR has this content. The slash command approaches runs on any comments on any PRs (or issues I think), which tends to be a lot (and sometimes it may take over some other workflows).

But in general I agree with you, we should stick to one way of implementing slash commands indeed.

runs-on: ubuntu-latest
steps:
- name: Set PR variables
id: pr
uses: actions/github-script@60a0d83039c74a4aee5e5cbf49f72e2045aa4292 # v7.0.1
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
core.setOutput('sha', pr.data.head.sha);
outputs:
sha: ${{ steps.pr.outputs.sha }}

backcompat-e2e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity

Suggested change
backcompat-e2e:
backwards-compatibility-e2e:

needs: [run-if-requested]
if: ${{ needs.run-if-requested.result == 'success' }}
concurrency:
group: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.k8s-name }}-${{ matrix.feature-flags }}-${{ github.event.issue.number }}
cancel-in-progress: true
name: e2e tests (backcompat)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity

Suggested change
name: e2e tests (backcompat)
name: e2e tests (backwards compatibility)

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
k8s-name:
- k8s-latest-minus-five # 1.29
- k8s-latest-minus-four # 1.30
- k8s-latest-minus-three # 1.31
- k8s-latest-minus-two # 1.32
- k8s-latest-minus-one # 1.33
feature-flags: [stable]
include:
- k8s-name: k8s-latest-minus-five
k8s-version: v1.29.x
- k8s-name: k8s-latest-minus-four
k8s-version: v1.30.x
- k8s-name: k8s-latest-minus-three
k8s-version: v1.31.x
- k8s-name: k8s-latest-minus-two
k8s-version: v1.32.x
- k8s-name: k8s-latest-minus-one
k8s-version: v1.33.x
env:
KO_DOCKER_REPO: registry.local:5000/tekton
CLUSTER_DOMAIN: c${{ github.run_id }}.local
ARTIFACTS: ${{ github.workspace }}/artifacts
steps:
- name: Report tests check
uses: actions/github-script@60a0d83039c74a4aee5e5cbf49f72e2045aa4292 # v7.0.1
id: check-run
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const check = await github.rest.checks.create({
name: 'run tests',
head_sha: '${{ needs.run-if-requested.outputs.sha }}',
status: 'in_progress',
details_url: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
...context.repo
})
return { id: check.data.id }

- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ needs.run-if-requested.outputs.sha }}
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: "go.mod"
- uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9

- name: Install Dependencies
run: |
echo '::group:: install go-junit-report'
go install github.com/jstemmer/[email protected]
echo '::endgroup::'
echo '::group:: created required folders'
mkdir -p "${ARTIFACTS}"
echo '::endgroup::'
echo "${GOPATH}/bin" >> "$GITHUB_PATH"

- name: Run tests
run: |
export PATH="$(echo "$PATH" | sed -e 's/^\/bin://'):/bin"
export KO_DEFAULTPLATFORMS=linux/$(go env GOARCH)
./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

- name: Upload test results
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: extra-tests-${{ matrix.k8s-version }}-${{ matrix.feature-flags }}
path: ${{ env.ARTIFACTS }}

- uses: chainguard-dev/actions/kind-diag@6f4f4de7549514e7b659741b30f6476f245600dd # v1.5.3
if: ${{ failure() }}
with:
artifact-name: extra-tests-${{ matrix.k8s-version }}-${{ matrix.feature-flags }}-logs

- name: Report tests check
if: success() || failure()
uses: actions/github-script@60a0d83039c74a4aee5e5cbf49f72e2045aa4292 # v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const resp = await github.rest.checks.update({
name: 'run tests',
check_run_id: ${{ fromJSON(steps.check-run.outputs.result).id }},
head_sha: '${{ needs.run-if-requested.outputs.sha }}',
status: 'completed',
conclusion: '${{ steps.tests-step.outcome }}',
details_url: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
output: {
title: 'Run tests',
summary: 'Results: ${{ steps.tests-step.outcome }}\n\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
},
...context.repo
})
console.log(`Check run create response: ${resp.status}`)
console.log(`Check run URL: ${resp.data.url}`)
console.log(`Check run HTML: ${resp.data.html_url}`)

- 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
52 changes: 3 additions & 49 deletions .github/workflows/e2e-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ jobs:

k8s-name:
- k8s-oldest # 1.28
- k8s-latest-minus-five # 1.29
- k8s-latest-minus-four # 1.30
- k8s-latest-minus-three # 1.31
- k8s-latest-minus-two # 1.32
- k8s-latest-minus-one # 1.33
- k8s-latest # 1.34

feature-flags:
Expand All @@ -38,60 +33,19 @@ jobs:
include:
- k8s-name: k8s-oldest
k8s-version: v1.28.x
- k8s-name: k8s-latest-minus-five
k8s-version: v1.29.x
- k8s-name: k8s-latest-minus-four
k8s-version: v1.30.x
- k8s-name: k8s-latest-minus-three
k8s-version: v1.31.x
- k8s-name: k8s-latest-minus-two
k8s-version: v1.32.x
- k8s-name: k8s-latest-minus-one
k8s-version: v1.33.x
- k8s-name: k8s-latest
k8s-version: v1.34.x

# Run beta and alpha only on latest and oldest
# Limit arm64: only run k8s-latest on arm64 (alpha and beta), skip oldest on arm64
exclude:
- k8s-name: k8s-latest-minus-five
feature-flags: beta
- k8s-name: k8s-latest-minus-five
feature-flags: alpha
- k8s-name: k8s-latest-minus-four
feature-flags: beta
- k8s-name: k8s-latest-minus-four
feature-flags: alpha
- k8s-name: k8s-latest-minus-three
feature-flags: beta
- k8s-name: k8s-latest-minus-three
feature-flags: alpha
- k8s-name: k8s-latest-minus-two
feature-flags: beta
- k8s-name: k8s-latest-minus-two
feature-flags: alpha
- k8s-name: k8s-latest-minus-one
feature-flags: beta
- k8s-name: k8s-latest-minus-one
feature-flags: alpha
# Only run latest on arm64
- k8s-name: k8s-oldest
os: ubuntu-24.04-arm
- k8s-name: k8s-latest-minus-five
os: ubuntu-24.04-arm
- k8s-name: k8s-latest-minus-four
os: ubuntu-24.04-arm
- k8s-name: k8s-latest-minus-three
os: ubuntu-24.04-arm
- k8s-name: k8s-latest-minus-two
os: ubuntu-24.04-arm
- k8s-name: k8s-latest-minus-one
os: ubuntu-24.04-arm
- k8s-name: k8s-latest
feature-flags: alpha
os: ubuntu-24.04-arm
- k8s-name: k8s-latest
feature-flags: beta
- k8s-name: k8s-latest
os: ubuntu-24.04-arm
feature-flags: alpha
env:
KO_DOCKER_REPO: registry.local:5000/tekton
CLUSTER_DOMAIN: c${{ github.run_id }}.local
Expand Down
Loading