Skip to content

Elasticsearch 8, Opensearch (Incomplete) #1095

Elasticsearch 8, Opensearch (Incomplete)

Elasticsearch 8, Opensearch (Incomplete) #1095

Workflow file for this run

name: CI
on:
pull_request:
workflow_call:
inputs:
version:
required: true
type: string
outputs:
modules:
description: "Stream reactor collection of modules"
value: ${{ jobs.initiate.outputs.matrix }}
jobs:
initiate:
timeout-minutes: 5
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.read-mods.outputs.matrix }}
it_matrix: ${{ steps.read-mods.outputs.it-matrix }}
fun_matrix: ${{ steps.read-mods.outputs.fun-matrix }}
dep_check_matrix: ${{ steps.read-mods.outputs.dep-check-matrix }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'sbt'
- name: Generate modules lists
run: sbt generateModulesList generateItModulesList generateFunModulesList generateDepCheckModulesList
env:
JVM_OPTS: -Xmx3200m
- name: Read modules lists
id: read-mods
run: |
echo "::set-output name=matrix::$(cat ./target/scala-2.13/resource_managed/main/modules.txt)"
echo "::set-output name=it-matrix::$(cat ./target/scala-2.13/resource_managed/main/it-modules.txt)"
echo "::set-output name=fun-matrix::$(cat ./target/scala-2.13/resource_managed/main/fun-modules.txt)"
echo "::set-output name=dep-check-matrix::$(cat ./target/scala-2.13/resource_managed/main/depcheck-modules.txt)"
- name: Cleanup before cache
shell: bash
run: |
rm -rf "$HOME/.ivy2/local" || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true
scalafmt:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'sbt'
- name: Check the project
run: sbt scalafmtCheck
env:
JVM_OPTS: -Xmx3200m
- name: Check the sbt files
run: sbt scalafmtSbtCheck
env:
JVM_OPTS: -Xmx3200m
test:
needs:
- initiate
- scalafmt
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
matrix:
module: ${{fromJSON(needs.initiate.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'sbt'
- name: Run tests
run: sbt "project ${{ matrix.module }}" test
env:
JVM_OPTS: -Xmx3200m
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: "**/target/**/test-reports/*.xml"
check_name: ${{ matrix.module }}-test-results
comment_mode: off
integration-test:
needs:
- initiate
- scalafmt
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
strategy:
matrix:
module: ${{fromJSON(needs.initiate.outputs.it_matrix)}}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'sbt'
- name: Run tests
run: sbt "project ${{ matrix.module }}" it:test
env:
JVM_OPTS: -Xmx3200m
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: "**/target/**/it-reports/*.xml"
check_name: ${{ matrix.module }}-it-results
comment_mode: off
build-and-cache-assembly:
needs:
- initiate
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
module: ${{fromJSON(needs.initiate.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
name: Checkout repository
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'sbt'
- name: Get version
id: version
shell: bash
run: |
if [ "${{ inputs.version }}" != "" ]; then
echo "::set-output name=version::${{ inputs.version }}"
else
echo "::set-output name=version::$(git describe --tags --always)"
fi
- name: Build assembly
env:
JVM_OPTS: -Xmx3200m
VERSION: ${{ steps.version.outputs.version }}
run: sbt "project ${{ matrix.module }};set assembly / test := {}" assembly
- name: Cache assembly
uses: actions/cache/save@v4
with:
path: ~/**/target/libs/*.jar
key: assembly-${{ matrix.module }}-${{ github.run_id }}
functional-test:
needs:
- initiate
- build-and-cache-assembly
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
module: ${{fromJSON(needs.initiate.outputs.fun_matrix)}}
connectImageVersion: [7.3.1, 6.2.2]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'sbt'
- name: Restore assembly
uses: actions/cache/restore@v4
with:
path: ~/**/target/libs/*.jar
key: assembly-${{ matrix.module }}-${{ github.run_id }}
fail-on-cache-miss: true
- name: Run tests
run: sbt "project ${{ matrix.module }}" fun:test
env:
JVM_OPTS: -Xmx3200m
CONNECT_IMAGE_VERSION: ${{matrix.connectImageVersion}}
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: "**/target/**/test-reports/*.xml"
check_name: ${{ matrix.module }}-${{ matrix.connectImageVersion }}-fun-results
comment_mode: off
dependency-check:
needs:
- initiate
- build-and-cache-assembly
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
module: ${{fromJSON(needs.initiate.outputs.dep_check_matrix)}}
steps:
- name: Restore assembly
uses: actions/cache/restore@v4
with:
path: ~/**/target/libs/*.jar
key: assembly-${{ matrix.module }}-${{ github.run_id }}
fail-on-cache-miss: true
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Dependency Check
uses: dependency-check/Dependency-Check_Action@main
with:
project: kafka-connect-${{matrix.module}}-deps
path: kafka-connect-${{matrix.module}}/target/libs/
format: 'HTML'
args: >-
--failOnCVSS 5
--suppression https://raw.githubusercontent.com/lensesio/stream-reactor/${{ steps.extract_branch.outputs.branch }}/suppression.xml
- name: Upload Test results
uses: actions/upload-artifact@master
with:
name: ${{matrix.module}}-depcheck-results
path: ${{github.workspace}}/reports
upload-assembly:
needs:
- initiate
- functional-test
- dependency-check
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
module: ${{fromJSON(needs.initiate.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'sbt'
- name: Restore assembly
uses: actions/cache/restore@v4
with:
path: ~/**/target/libs/*.jar
key: assembly-${{ matrix.module }}-${{ github.run_id }}
fail-on-cache-miss: true
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: assembly-${{ matrix.module }}-${{ github.run_id }}
path: ~/**/target/libs/*.jar