diff --git a/.github/workflows/fvt-main.yml b/.github/workflows/fvt-main.yml new file mode 100644 index 000000000..1cdfb4c5d --- /dev/null +++ b/.github/workflows/fvt-main.yml @@ -0,0 +1,36 @@ +name: FVT +on: + merge_group: + push: + branches: + - main +jobs: + fvt: + name: Test with Kafka ${{ matrix.kafka-version }} + strategy: + fail-fast: false + matrix: + go-version: [1.21.x] + kafka-version: [1.0.2, 2.0.1, 2.2.2, 2.6.2, 2.8.2, 3.0.2, 3.3.2, 3.5.1] + include: + - kafka-version: 1.0.2 + scala-version: 2.11 + - kafka-version: 2.0.1 + scala-version: 2.12 + - kafka-version: 2.2.2 + scala-version: 2.12 + - kafka-version: 2.6.2 + scala-version: 2.12 + - kafka-version: 2.8.2 + scala-version: 2.12 + - kafka-version: 3.0.2 + scala-version: 2.12 + - kafka-version: 3.3.2 + scala-version: 2.13 + - kafka-version: 3.5.1 + scala-version: 2.13 + uses: ./.github/workflows/fvt.yml + with: + go-version: ${{ matrix.go-version }} + kafka-version: ${{ matrix.kafka-version }} + scala-version: ${{ matrix.scala-version }} diff --git a/.github/workflows/fvt-pr.yml b/.github/workflows/fvt-pr.yml new file mode 100644 index 000000000..39af91bea --- /dev/null +++ b/.github/workflows/fvt-pr.yml @@ -0,0 +1,25 @@ +name: FVT +on: + pull_request: + branches: + - "**" +jobs: + fvt: + name: Test with Kafka ${{ matrix.kafka-version }} + strategy: + fail-fast: false + matrix: + go-version: [1.21.x] + kafka-version: [1.0.2, 2.6.2, 3.5.1] + include: + - kafka-version: 1.0.2 + scala-version: 2.11 + - kafka-version: 2.6.2 + scala-version: 2.12 + - kafka-version: 3.5.1 + scala-version: 2.13 + uses: ./.github/workflows/fvt.yml + with: + go-version: ${{ matrix.go-version }} + kafka-version: ${{ matrix.kafka-version }} + scala-version: ${{ matrix.scala-version }} diff --git a/.github/workflows/fvt.yml b/.github/workflows/fvt.yml index d0c13e364..c6d93cccd 100644 --- a/.github/workflows/fvt.yml +++ b/.github/workflows/fvt.yml @@ -1,33 +1,28 @@ name: FVT on: - merge_group: - push: - branches: - - main - pull_request: - branches: - - "**" + workflow_call: + inputs: + go-version: + required: false + type: string + default: 1.21.x + kafka-version: + required: false + type: string + default: 3.5.1 + scala-version: + required: false + type: string + default: 2.13 jobs: fvt: - name: Test with Kafka ${{ matrix.kafka-version }} + name: Test with Kafka ${{ inputs.kafka-version }} runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - go-version: [1.21.x] - kafka-version: [3.3.2, 3.4.1, 3.5.1] - include: - - kafka-version: 3.3.2 - scala-version: 2.13 - - kafka-version: 3.4.1 - scala-version: 2.13 - - kafka-version: 3.5.1 - scala-version: 2.13 env: DEBUG: true GOFLAGS: -trimpath - KAFKA_VERSION: ${{ matrix.kafka-version }} - SCALA_VERSION: ${{ matrix.scala-version }} + KAFKA_VERSION: ${{ inputs.kafka-version }} + SCALA_VERSION: ${{ inputs.scala-version }} steps: - uses: actions/checkout@v3 - name: Setup Docker @@ -45,7 +40,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ${{ matrix.go-version }} + 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 @@ -54,19 +49,19 @@ jobs: docker-compose version - name: Test (Functional) run: | - nohup sudo tcpdump -i lo -w "fvt-kafka-${{ matrix.kafka-version }}.pcap" portrange 29091-29095 >/dev/null 2>&1 & + 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-${{ matrix.kafka-version }}.pcap" ]; then sudo chmod a+r "fvt-kafka-${{ matrix.kafka-version }}.pcap"; 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@v3 with: - name: fvt-kafka-${{ matrix.kafka-version }}.pcap - path: fvt-kafka-${{ matrix.kafka-version }}.pcap + name: fvt-kafka-${{ inputs.kafka-version }}.pcap + path: fvt-kafka-${{ inputs.kafka-version }}.pcap retention-days: 5 if-no-files-found: ignore