-
Notifications
You must be signed in to change notification settings - Fork 370
113 lines (100 loc) · 3.52 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
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
ciliumCliVersion: v0.15.0
jobs:
list-e2e-pkg:
runs-on: ubuntu-22.04
outputs:
packages: ${{ steps.set-packages.outputs.packages }}
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.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
run-e2e-test:
needs: list-e2e-pkg
runs-on: ${{ matrix.os }}
timeout-minutes: 40
name: ${{matrix.os}} / ${{ matrix.package.s }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, ubuntu-22.04-arm64 ]
package: ${{fromJson(needs.list-e2e-pkg.outputs.packages)}}
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: go/src/github.com/cilium/tetragon/
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
# renovate: datasource=golang-version depName=go
go-version: '1.22.9'
- 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 "sha=${SHA}" >> $GITHUB_OUTPUT
echo "agentImage=quay.io/cilium/tetragon-ci:${SHA}" >> $GITHUB_OUTPUT
echo "operatorImage=quay.io/cilium/tetragon-operator-ci:${SHA}" >> $GITHUB_OUTPUT
- name: Install kubectl, kind and cilium CLI
uses: alexellis/arkade-get@master
with:
kubectl: latest
helm: v3.12.1
kind: v0.20.0
cilium: ${{ env.ciliumCliVersion }}
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 ${{ steps.vars.outputs.agentImage }}
docker pull ${{ steps.vars.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=${{ steps.vars.outputs.agentImage }} E2E_OPERATOR=${{ steps.vars.outputs.operatorImage }} EXTRA_TESTFLAGS="-cluster-name=${{ env.clusterName }} -args -v=4"
- name: Upload Tetragon Logs
if: failure() || cancelled()
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: tetragon-logs-${{ matrix.os }}
path: /tmp/tetragon.e2e.*
retention-days: 5