-
Notifications
You must be signed in to change notification settings - Fork 1.7k
72 lines (70 loc) · 2.53 KB
/
fvt.yml
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
name: FVT
on:
workflow_call:
inputs:
go-version:
required: false
type: string
default: 1.22.x
kafka-version:
required: false
type: string
default: 3.6.0
scala-version:
required: false
type: string
default: 2.13
permissions:
contents: read # for actions/checkout to fetch code
jobs:
fvt:
name: Test with Kafka ${{ inputs.kafka-version }}
runs-on: ubuntu-latest
env:
DEBUG: true
GOFLAGS: -trimpath
KAFKA_VERSION: ${{ inputs.kafka-version }}
SCALA_VERSION: ${{ inputs.scala-version }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Docker
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
id: buildx
- name: Build FVT Docker Image
uses: docker/bake-action@52a1696536aaa8818afd3753a71ec46298b8a19b # master
with:
builder: ${{ steps.buildx.outputs.name }}
files: docker-compose.yml
load: true
targets: kafka-1
set: |
*.cache-from=type=gha,scope=${{ github.workflow }}
*.cache-to=type=gha,scope=${{ github.workflow }},mode=max
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ inputs.go-version }}
- name: Setup Docker Compose
run: |
curl -sSL "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /tmp/docker-compose
sudo install -m755 /tmp/docker-compose "$(dirname $(which docker-compose))"
docker version --format 'Docker Engine version v{{.Server.Version}}'
docker-compose version
- name: Test (Functional)
run: |
nohup sudo tcpdump -i lo -w "fvt-kafka-${{ inputs.kafka-version }}.pcap" portrange 29091-29095 >/dev/null 2>&1 &
echo $! >tcpdump.pid
make test_functional
- name: Stop tcpdump
if: always()
run: |
if [ -f "tcpdump.pid" ]; then sudo kill "$(cat tcpdump.pid)" || true; fi
if [ -f "fvt-kafka-${{ inputs.kafka-version }}.pcap" ]; then sudo chmod a+r "fvt-kafka-${{ inputs.kafka-version }}.pcap"; fi
- name: Upload pcap file
if: always()
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
with:
name: fvt-kafka-${{ inputs.kafka-version }}.pcap
path: fvt-kafka-${{ inputs.kafka-version }}.pcap
retention-days: 5
if-no-files-found: ignore