diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 000000000..372fe80dd --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,62 @@ +name: Java CI + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + java-version: ["8", "14", "17"] + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Install JDK ${{ matrix.java-version }} + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 + with: + java-version: ${{ matrix.java-version }} + distribution: "adopt" + - name: Cache Maven repository + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: ~/.m2/repository + key: maven-${{ runner.os }}-${{ matrix.java-version }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + maven-${{ runner.os }}-${{ matrix.java-version }}- + - name: Compile + run: ./scripts/run_no_prep_tests.sh clean test-compile + env: + CI_ARGS: "--batch-mode" + MAVEN_OPTS: "-Xmx10g -Xms1g" + - name: Run tests + run: ./scripts/run_no_prep_tests.sh test + env: + CI_ARGS: "--batch-mode" + SKIP_UNSTABLE_TESTS: 1 + - name: Upload test results to Codecov + if: ${{ !cancelled() && hashFiles('**/target/surefire-reports/TEST-*.xml') != '' }} + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 + with: + directory: . + files: "**/target/surefire-reports/TEST-*.xml" + fail_ci_if_error: true + flags: jdk-${{ matrix.java-version }} + report_type: test_results + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage to Codecov + if: ${{ !cancelled() && startsWith(matrix.java-version, '14') && hashFiles('**/target/site/jacoco/jacoco.xml') != '' }} + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 + with: + files: "**/target/site/jacoco/jacoco.xml" + flags: jdk-${{ matrix.java-version }} + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/unit-tests-jdk-14.yml b/.github/workflows/unit-tests-jdk-14.yml deleted file mode 100644 index 48c1c0f56..000000000 --- a/.github/workflows/unit-tests-jdk-14.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: JDK 14 Build & Tests - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - matrix: - java-version: ["14"] - permissions: - contents: read - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Install JDK - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 - with: - java-version: ${{ matrix.java-version }} - distribution: "adopt" - - name: Run all tests - run: | - ./scripts/run_no_prep_tests.sh -ci - env: - SKIP_UNSTABLE_TESTS: 1 - - name: Upload coverage to Codecov - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 - with: - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/unit-tests-jdk-17.yml b/.github/workflows/unit-tests-jdk-17.yml deleted file mode 100644 index d1a5f07a4..000000000 --- a/.github/workflows/unit-tests-jdk-17.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: JDK 17 Build & Tests - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - matrix: - java-version: ["17"] - permissions: - contents: read - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Install JDK - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 - with: - java-version: ${{ matrix.java-version }} - distribution: "adopt" - - name: Run all tests - run: | - ./scripts/run_no_prep_tests.sh -ci - env: - SKIP_UNSTABLE_TESTS: 1 diff --git a/.github/workflows/unit-tests-jdk-8.yml b/.github/workflows/unit-tests-jdk-8.yml deleted file mode 100644 index b38a00025..000000000 --- a/.github/workflows/unit-tests-jdk-8.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: JDK 1.8 Build & Tests - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - matrix: - java-version: ["8"] - permissions: - contents: read - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Install JDK - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 - with: - java-version: ${{ matrix.java-version }} - distribution: "adopt" - - name: Run all tests - run: | - if [ ${{ matrix.java-version }} == "8" ]; then - export TRAVIS_JDK=openjdk8 - fi - ./scripts/run_no_prep_tests.sh -ci - env: - SKIP_UNSTABLE_TESTS: 1 diff --git a/bolt-micronaut/pom.xml b/bolt-micronaut/pom.xml index f151cd931..75c25d2d5 100644 --- a/bolt-micronaut/pom.xml +++ b/bolt-micronaut/pom.xml @@ -146,7 +146,7 @@ -parameters - + io.micronaut micronaut-inject-java @@ -164,7 +164,7 @@ -parameters - + io.micronaut micronaut-inject-java diff --git a/lombok.config b/lombok.config index 7a21e8804..df71bb6a0 100644 --- a/lombok.config +++ b/lombok.config @@ -1 +1,2 @@ +config.stopBubbling = true lombok.addLombokGeneratedAnnotation = true diff --git a/pom.xml b/pom.xml index d20f9ef0e..2bc111b12 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ see also: https://github.com/slackapi/java-slack-sdk/issues/1034 --> 1.7.36 - 1.18.36 + 1.18.42 1.18.20.0 target/generated-sources-for-javadocs @@ -84,7 +84,7 @@ 1.3.0 2.8.2 - 3.8.1 + 3.13.0 1.8 1.8 2.6 @@ -203,6 +203,13 @@ ${maven-compiler-plugin.version} UTF-8 + + + org.projectlombok + lombok + ${lombok.version} + + diff --git a/scripts/install_local.sh b/scripts/install_local.sh index ee647312a..484f75df3 100755 --- a/scripts/install_local.sh +++ b/scripts/install_local.sh @@ -1,7 +1,6 @@ #!/bin/bash is_jdk_8=`echo $JAVA_HOME | grep 8.` -is_travis_jdk_8=`echo $TRAVIS_JDK | grep openjdk8` -if [[ "${is_jdk_8}" != "" && "${is_travis_jdk_8}" != "" ]]; +if [[ "${is_jdk_8}" != "" ]]; then echo "Please use OpenJDK 11." exit 1 diff --git a/scripts/release.sh b/scripts/release.sh index bbc14b80e..008d9e163 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,8 +1,7 @@ #!/bin/bash is_jdk_8=$(echo "$JAVA_HOME" | grep 8.) -is_travis_jdk_8=$(echo "$TRAVIS_JDK" | grep openjdk8) -if [[ "${is_jdk_8}" != "" && "${is_travis_jdk_8}" != "" ]]; +if [[ "${is_jdk_8}" != "" ]]; then echo "Please use OpenJDK 11 for releasing these libraries." exit 1 diff --git a/scripts/run_all_bolt_tests.sh b/scripts/run_all_bolt_tests.sh index 592da076c..19ffa968c 100755 --- a/scripts/run_all_bolt_tests.sh +++ b/scripts/run_all_bolt_tests.sh @@ -1,7 +1,6 @@ #!/bin/bash is_jdk_8=`echo $JAVA_HOME | grep 8.` -is_travis_jdk_8=`echo $TRAVIS_JDK | grep openjdk8` -if [[ "${is_jdk_8}" != "" && "${is_travis_jdk_8}" != "" ]]; +if [[ "${is_jdk_8}" != "" ]]; then echo "Please use OpenJDK 11 for running these tests." exit 1 diff --git a/scripts/run_no_prep_tests.sh b/scripts/run_no_prep_tests.sh index abdbe37e5..2b5a9ddf6 100755 --- a/scripts/run_no_prep_tests.sh +++ b/scripts/run_no_prep_tests.sh @@ -1,27 +1,20 @@ #!/bin/bash -flags() -{ - while test $# -gt 0 - do - case "$1" in - -ci) - CI_OPTIONS="--batch-mode -T 1C" - ;; - *) usage;; - esac - shift - done -} -flags "$@" +# Usage: ./scripts/run_no_prep_tests.sh [goals...] +# +# Arguments: Maven phases/goals to run (default: clean test) +# +# Environment variables: +# CI_ARGS - Additional Maven CLI options (e.g., "--batch-mode -T 1C") + +MVN_PHASES="${*:-clean test}" is_jdk_8=`echo $JAVA_HOME | grep 8.` is_jdk_14=`echo $JAVA_HOME | grep 14.` -is_travis_jdk_8=`echo $TRAVIS_JDK | grep openjdk8` -if [[ "${is_jdk_8}" != "" && "${is_travis_jdk_8}" != "" ]]; +if [[ "${is_jdk_8}" != "" ]]; then - ./mvnw ${MAVEN_OPTS} \ + ./mvnw \ -pl !bolt-google-cloud-functions \ -pl !bolt-helidon \ -pl !bolt-quarkus-examples \ @@ -31,29 +24,26 @@ then -pl !bolt-http4k \ -pl !bolt-micronaut \ -pl !slack-jakarta-socket-mode-client \ - clean \ - test-compile \ - '-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false test ${CI_OPTIONS} \ + $MVN_PHASES \ + '-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false ${CI_ARGS} \ -DfailIfNoTests=false \ -Dhttps.protocols=TLSv1.2 \ --no-transfer-progress && \ if git status --porcelain | grep .; then git --no-pager diff; exit 1; fi elif [[ "${is_jdk_14}" != "" ]]; then - ./mvnw ${MAVEN_OPTS} \ + ./mvnw \ -pl !bolt-micronaut \ - clean \ - test-compile \ - '-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false test ${CI_OPTIONS} \ + $MVN_PHASES \ + '-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false ${CI_ARGS} \ -DfailIfNoTests=false \ -Dhttps.protocols=TLSv1.2 \ --no-transfer-progress && \ if git status --porcelain | grep .; then git --no-pager diff; exit 1; fi else - ./mvnw ${MAVEN_OPTS} \ - clean \ - test-compile \ - '-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false test ${CI_OPTIONS} \ + ./mvnw \ + $MVN_PHASES \ + '-Dtest=test_locally.**.*Test' -Dsurefire.failIfNoSpecifiedTests=false ${CI_ARGS} \ -DfailIfNoTests=false \ -Dhttps.protocols=TLSv1.2 \ --no-transfer-progress && \