-
Notifications
You must be signed in to change notification settings - Fork 392
129 lines (116 loc) · 4.33 KB
/
run-e2e-tests.yaml
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
name: Tetragon e2e Test
on:
pull_request:
paths-ignore:
- 'docs/**'
push:
branches:
- main
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
clusterName: tetragon-ci
jobs:
prepare:
runs-on: ubuntu-22.04
outputs:
packages: ${{ steps.set-packages.outputs.packages }}
agentImage: ${{ steps.vars.outputs.agentImage }}
operatorImage: ${{ steps.vars.outputs.operatorImage }}
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
- id: set-packages
name: Listing e2e tests packages
shell: bash
run: |
echo PACKAGES=$(make ls-e2e-test | jq -Rnc '[inputs | {"s": split("/")[-1], "f":.}]') | tee -a $GITHUB_STEP_SUMMARY | tee -a $GITHUB_OUTPUT
- name: Set Up Job Variables
id: vars
run: |
if [ ${{ github.event.issue.pull_request || github.event.pull_request }} ]; then
PR_API_JSON=$(curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
${{ github.event.issue.pull_request.url || github.event.pull_request.url }})
SHA=$(echo "$PR_API_JSON" | jq -r ".head.sha")
else
SHA=${{ github.sha }}
fi
echo "agentImage=quay.io/cilium/tetragon-ci:${SHA}" >> $GITHUB_OUTPUT
echo "operatorImage=quay.io/cilium/tetragon-operator-ci:${SHA}" >> $GITHUB_OUTPUT
- name: Wait Tetragon Images
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
timeout_minutes: 2
max_attempts: 30
retry_wait_seconds: 30
warning_on_retry: false
command: |
set -e
docker pull ${{ steps.vars.outputs.agentImage }}
docker pull ${{ steps.vars.outputs.operatorImage }}
docker rmi ${{ steps.vars.outputs.agentImage }} ${{ steps.vars.outputs.operatorImage }}
run-e2e-test:
needs: prepare
runs-on: ${{ matrix.os }}
timeout-minutes: 20
name: ${{matrix.os}} / ${{ matrix.package.s }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, ubuntu-22.04-arm64 ]
package: ${{fromJson(needs.prepare.outputs.packages)}}
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: go/src/github.com/cilium/tetragon/
- name: Install Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
# renovate: datasource=golang-version depName=go
go-version: '1.24.0'
- name: Install kubectl, kind and cilium CLI
uses: alexellis/arkade-get@master
with:
# renovate: datasource=github-releases depName=kubernetes/kubernetes
kubectl: v1.32.2
# renovate: datasource=github-releases depName=helm/helm
helm: v3.17.1
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
kind: v0.27.0
# renovate: datasource=github-releases depName=cilium/cilium-cli
cilium: v0.16.24
print-summary: false
- name: Pull Tetragon Images
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
timeout_minutes: 2
max_attempts: 30
retry_wait_seconds: 30
warning_on_retry: false
command: |
set -e
docker pull ${{ needs.prepare.outputs.agentImage }}
docker pull ${{ needs.prepare.outputs.operatorImage }}
- name: Run e2e Tests
env:
GHA_OS: ${{matrix.os}}
run: |
cd go/src/github.com/cilium/tetragon
make e2e-test E2E_TESTS=${{matrix.package.f}} E2E_BUILD_IMAGES=0 E2E_AGENT=${{ needs.prepare.outputs.agentImage }} E2E_OPERATOR=${{ needs.prepare.outputs.operatorImage }} EXTRA_TESTFLAGS="-cluster-name=${{ env.clusterName }} -args -v=4"
- name: Upload Tetragon Logs
if: failure() || cancelled()
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: tetragon-logs-${{ matrix.os }}-${{ matrix.package.s }}
path: /tmp/tetragon.e2e.*
retention-days: 5