Repository navigation
Build - pull_request #1793
Workflow file for this run
This file contains hidden or 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
| # Check Build | |
| # | |
| # Description: | |
| # Runs the build for every java version we support | |
| # | |
| # Triggers: | |
| # - pull_request: when a PR is sent to us | |
| # - push: when code is pushed to a specified branch | |
| # | |
| # Notes: | |
| # Builds against Java 17, 21, and 25 which are the supported versions. | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - 'powertools-batch/**' | |
| - 'powertools-core/**' | |
| - 'powertools-cloudformation/**' | |
| - 'powertools-common/**' | |
| - 'powertools-e2e-tests/**' | |
| - 'powertools-idempotency/**' | |
| - 'powertools-large-messages/**' | |
| - 'powertools-logging/**' | |
| - 'powertools-metrics/**' | |
| - 'powertools-kafka/**' | |
| - 'powertools-parameters/**' | |
| - 'powertools-serialization/**' | |
| - 'powertools-sqs/**' | |
| - 'powertools-tracing/**' | |
| - 'powertools-tracing/**' | |
| - 'powertools-validation/**' | |
| - 'powertools-lambda-metadata/**' | |
| - 'examples/**' | |
| - 'pom.xml' | |
| - 'examples/pom.xml' | |
| - '.github/workflows/**' | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'powertools-batch/**' | |
| - 'powertools-core/**' | |
| - 'powertools-cloudformation/**' | |
| - 'powertools-common/**' | |
| - 'powertools-e2e-tests/**' | |
| - 'powertools-idempotency/**' | |
| - 'powertools-large-messages/**' | |
| - 'powertools-logging/**' | |
| - 'powertools-metrics/**' | |
| - 'powertools-kafka/**' | |
| - 'powertools-parameters/**' | |
| - 'powertools-serialization/**' | |
| - 'powertools-sqs/**' | |
| - 'powertools-tracing/**' | |
| - 'powertools-tracing/**' | |
| - 'powertools-validation/**' | |
| - 'powertools-lambda-metadata/**' | |
| - 'pom.xml' | |
| - 'examples/**' | |
| - 'examples/pom.xml' | |
| - '.github/workflows/**' | |
| name: Build | |
| permissions: | |
| contents: read | |
| run-name: Build - ${{ github.event_name }} | |
| jobs: | |
| java-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: | |
| - 17 | |
| - 21 | |
| - 25 | |
| steps: | |
| - id: checkout | |
| name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Java | |
| uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 | |
| with: | |
| distribution: corretto | |
| java-version: ${{ matrix.java }} | |
| cache: maven | |
| - id: build-maven | |
| name: Build (Maven) | |
| run: | | |
| mvn -B -q install --file pom.xml | |
| graalvm-build: | |
| runs-on: aws-powertools_ubuntu-latest_8-core | |
| steps: | |
| - id: checkout | |
| name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 | |
| with: | |
| files: | | |
| powertools-*/** | |
| pom.xml | |
| - name: Setup GraalVM | |
| uses: graalvm/setup-graalvm@27b360dbb857524eaf0b4c4cef364d38e5b4f173 # v1.6.7 | |
| with: | |
| java-version: "25" | |
| # Pinned to the GraalVM 25.4.4.1.1 innovation release. GraalVM 25.0 LTS cannot read Java 25 class files | |
| # for predefined classes (oracle/graal#12723). Move back to the LTS release once the fix is backported. | |
| # See #2416 | |
| version: "25.4.4.1.1" | |
| distribution: "graalvm" | |
| cache: maven | |
| - id: graalvm-native-test | |
| name: GraalVM Native Test | |
| if: steps.changed-files.outputs.any_changed == 'true' | |
| env: | |
| CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
| run: | | |
| # Build the entire project first to ensure test-jar dependencies are available | |
| echo "::group::Building project dependencies" | |
| mvn -B -q install -DskipTests | |
| echo "::endgroup::" | |
| echo "Changes detected in powertools modules: $CHANGED_FILES" | |
| # Find modules with native profile and run tests with the tracing agent | |
| find . -name "pom.xml" -path "./powertools-*" | while read module; do | |
| if grep -q "<id>native</id>" "$module"; then | |
| module_dir=$(dirname "$module") | |
| module_name=$(basename "$module_dir") | |
| # Check if this specific module or common dependencies changed | |
| if echo "$CHANGED_FILES" | grep -q "$module_name/" || \ | |
| echo " $CHANGED_FILES " | grep -q " pom.xml " || \ | |
| echo "$CHANGED_FILES" | grep -q "powertools-common/"; then | |
| echo "::group::Building $module_name with GraalVM" | |
| echo "Changes detected in $module_name - running GraalVM native tests" | |
| mvn -B -q -f "$module" -Pnative -Dagent=true clean test | |
| echo "::endgroup::" | |
| else | |
| echo "No changes detected in $module_name - skipping GraalVM tests" | |
| fi | |
| fi | |
| done |