Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
85 changes: 72 additions & 13 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,87 @@
name: Java Main Workflow

on:
pull_request:
branches: [ master, rc-** ]
# pull_request:
# branches: [ master, rc-** ]

jobs:
detect-targets:
runs-on: ubuntu-latest
outputs:
modified_targets: ${{ steps.filter.outputs.modified_targets }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Detect modified targets
id: filter
run: |
MODIFIED_TARGETS=()

# Ensure HEAD^ exists
if git rev-parse --verify HEAD^ >/dev/null 2>&1; then
BASE_COMMIT="HEAD^"
else
BASE_COMMIT=$(git rev-list --max-parents=0 HEAD) # First commit
fi

# Check each client dynamically
find clients/* -type d -maxdepth 0 | while read client; do
CLIENT_NAME=$(basename "$client")
if ! git diff --quiet "$BASE_COMMIT" HEAD -- "$client"; then
echo "Changes detected in $CLIENT_NAME"
MODIFIED_TARGETS+=("$CLIENT_NAME")
fi
done

# Convert to JSON array format
MODIFIED_TARGETS_JSON=$(printf '%s\n' "${MODIFIED_TARGETS[@]}" | jq -R -s -c 'split("\n") | map(select(. != ""))')

echo "Detected modified targets: $MODIFIED_TARGETS_JSON"
echo "modified_targets=$MODIFIED_TARGETS_JSON" >> $GITHUB_ENV
echo "::set-output name=modified_targets::$MODIFIED_TARGETS_JSON"
checkstyle:
runs-on: ubuntu-latest
needs: detect-targets
if: ${{ needs.detect-targets.outputs.modified_targets != '[]' }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
cache: 'maven'
cache-dependency-path: |
'clients/pom.xml'
'examples/pom.xml'
- name: Validate modules
run: |
mvn -f clients/pom.xml -N install
mvn -f clients/pom.xml -pl common install
mvn -f clients/pom.xml -pl `echo '${{ needs.detect-targets.outputs.modified_targets }}' | jq -r 'join(",")'` validate
build:
runs-on: ${{ matrix.operating-system }}
runs-on: ubuntu-latest
needs: detect-targets
if: ${{ needs.detect-targets.outputs.modified_targets != '[]' }}
strategy:
matrix:
operating-system: [ ubuntu-latest ]
java-version: [ 8, 11, 17 ]

target: ${{ fromJson(needs.detect-targets.outputs.modified_targets) }}
java-version: [ 11, 17 ]
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
cache: 'maven'
- name: Run checkstyle
run: mvn checkstyle:check
- name: Run unit tests
run: mvn clean test
- name: Build with Maven
run: mvn install '-Dgpg.skip=true' '-Dmaven.javadoc.skip=true'
cache-dependency-path: |
'clients/pom.xml'
'examples/pom.xml'
- name: Build ${{ matrix.target }} module
run: |
mvn -f clients/pom.xml -N install
mvn -f clients/pom.xml -pl common,${{ matrix.target }} install -Dcheckstyle.skip=true
34 changes: 0 additions & 34 deletions .github/workflows/release.yml

This file was deleted.

Loading