work on push too #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI-java | |
on: | |
push: | |
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.java-mods.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Generate modules lists | |
run: cd 'java-connectors' && ./gradlew releaseModuleList | |
env: | |
JVM_OPTS: -Xmx512m | |
- name: Read java modules lists | |
id: java-mods | |
run: | | |
echo "::set-output name=matrix::$(cat ./java-connectors/gradle-modules.txt)" | |
test: | |
needs: | |
- initiate | |
strategy: | |
matrix: | |
module: ${{fromJSON(needs.initiate.outputs.matrix)}} | |
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' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 8.6 | |
- name: Test with Gradle | |
run: cd 'java-connectors' && ./gradlew ${{ matrix.module }}:test | |
build-and-dependency-check: | |
needs: | |
- test | |
- initiate | |
strategy: | |
matrix: | |
module: ${{fromJSON(needs.initiate.outputs.matrix)}} | |
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: gradle | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 8.6 | |
- name: Execute Gradle build | |
run: cd 'java-connectors' && ./gradlew ${{ matrix.module }}:shadowJar --scan | |
- name: Move to release folder | |
shell: bash | |
run: | | |
JAVA_RELEASE_FOLDER=java-connectors/release | |
JAVA_BUILD_FOLDER=java-connectors/${{ matrix.module }}/build/libs | |
mkdir -p $JAVA_RELEASE_FOLDER | |
cp $JAVA_BUILD_FOLDER/${{ matrix.module }}*.jar LICENSE $JAVA_RELEASE_FOLDER/ | |
- name: Cache assembly | |
uses: actions/cache/save@v4 | |
with: | |
path: ./java-connectors/release/${{ matrix.module }}*.jar | |
key: assembly-java-${{ github.run_id }} | |
jar-dependency-check: | |
needs: | |
- build-and-dependency-check | |
- initiate | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
module: ${{fromJSON(needs.initiate.outputs.matrix)}} | |
steps: | |
- name: Restore assembly | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/**/target/libs/*.jar | |
key: assembly-java-${{ github.run_id }} | |
fail-on-cache-miss: true | |
- name: Get branch names. | |
id: branch_name | |
uses: tj-actions/branch-names@v8 | |
- 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/${{ github.event.pull_request.head.repo.owner.login }}/${{github.event.repository.name}}/${{ steps.branch_name.outputs.tag }}${{ steps.branch_name.outputs.current_branch }}/suppression.xml | |
- name: Upload Test results | |
uses: actions/upload-artifact@master | |
with: | |
name: ${{matrix.module}}-depcheck-results | |
path: ${{github.workspace}}/reports |