diff --git a/dependabot.yml b/.github/dependabot.yml similarity index 100% rename from dependabot.yml rename to .github/dependabot.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e8ef840..c5bdaf7 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -59,31 +59,33 @@ jobs: # SHALLOW CLONE # ================================ - name: Shallow clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 # ================================ # SET UP JDK # ================================ - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-package: jdk java-version: 21 # ================================ - # SETUP GRADLE + # SET UP GRADLE # ================================ - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} + build-scan-publish: true + build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use" + build-scan-terms-of-use-agree: "yes" + cache-read-only: ${{ github.ref_name != github.event.repository.default_branch && github.ref_name != 'develop' }} # ================================ # BENCHMARK # ================================ - name: Benchmark - uses: gradle/gradle-build-action@v2 env: JMH_VERSION: ${{ inputs.jmhVersion }} JMH_BENCHMARK_MODE: ${{ inputs.benchmarkMode }} @@ -91,14 +93,13 @@ jobs: JMH_ITERATIONS: ${{ inputs.iterations }} JMH_FORK: ${{ inputs.fork }} JMH_THREADS: ${{ inputs.threads }} - with: - arguments: jmh -x jmhReport --info --scan + run: ./gradlew jmh -x jmhReport # ================================ # UPLOAD RESULTS # ================================ - name: Upload Results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: results.json path: ./benchmark/build/reports/jmh/results.json @@ -108,15 +109,12 @@ jobs: # ================================ - name: Generate Report if: ${{ inputs.publish }} - uses: gradle/gradle-build-action@v2 - with: - arguments: jmhReport --info --scan + run: ./gradlew jmhReport # ================================ # MAKE BADGE # ================================ - name: Make Badge - if: ${{ inputs.publish }} shell: bash run: | SCENARIO="com.leakyabstractions.result.benchmark.SimpleFailureScenario" @@ -124,7 +122,7 @@ jobs: SCORE_EXCEPTIONS=`jq ".[] | select(.benchmark == \"$SCENARIO.exceptions\").primaryMetric.score" ./benchmark/build/reports/jmh/results.json` TIMES_FASTER=`printf "%.0f\n" $(jq -n "$SCORE_RESULTS / $SCORE_EXCEPTIONS")` LOGO_CONTENTS=`cat ./benchmark/build/reports/jmh/badge-logo.svg` - echo "According to the benchmark, returning a failed result is $TIMES_FASTER times faster than throwing an exception" + echo "According to the benchmark, returning a failed result is $TIMES_FASTER times faster than throwing an exception" >> $GITHUB_STEP_SUMMARY jq -n ".schemaVersion |= 1 | .style |= \"for-the-badge\" | .labelColor |= \"eee\" | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a016881..5ece6cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,13 +23,13 @@ jobs: # SHALLOW CLONE # ================================ - name: Shallow clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 # ================================ # SET UP JDK # ================================ - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-package: jdk @@ -39,20 +39,21 @@ jobs: # VALIDATE GRADLE WRAPPER # ================================ - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/wrapper-validation-action@v3 # ================================ - # SETUP GRADLE + # SET UP GRADLE # ================================ - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} + build-scan-publish: true + build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use" + build-scan-terms-of-use-agree: "yes" + cache-read-only: ${{ github.ref_name != github.event.repository.default_branch && github.ref_name != 'develop' }} # ================================ # CHECK # ================================ - name: Check - uses: gradle/gradle-build-action@v2 - with: - arguments: check --info --scan + run: ./gradlew check diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml new file mode 100644 index 0000000..6f81579 --- /dev/null +++ b/.github/workflows/dependencies.yml @@ -0,0 +1,41 @@ + +# Submit dependencies +name: Dependencies + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + dependencies: + + name: Submit dependencies + runs-on: ubuntu-latest + + steps: + + # ================================ + # SHALLOW CLONE + # ================================ + - name: Shallow clone + uses: actions/checkout@v4 + + # ================================ + # SET UP JDK + # ================================ + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-package: jdk + java-version: 21 + + # ================================ + # SUBMIT DEPENDENCIES + # ================================ + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@v3 diff --git a/.github/workflows/update-gradle-wrapper.yml b/.github/workflows/update-gradle-wrapper.yml index 8e8654a..edb6bca 100644 --- a/.github/workflows/update-gradle-wrapper.yml +++ b/.github/workflows/update-gradle-wrapper.yml @@ -18,7 +18,7 @@ jobs: # SHALLOW CLONE # ================================ - name: Shallow clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 # ================================ # UPDATE GRADLE WRAPPER @@ -27,5 +27,5 @@ jobs: uses: gradle-update/update-gradle-wrapper-action@v1 with: release-channel: stable - base-branch: main + base-branch: develop target-branch: develop diff --git a/benchmark/build.gradle b/benchmark/build.gradle index 3e3e6ce..1f65ac4 100644 --- a/benchmark/build.gradle +++ b/benchmark/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id "me.champeau.jmh" version "0.7.2" - id "io.morethan.jmhreport" version "0.9.0" + id "io.morethan.jmhreport" version "0.9.6" } repositories { @@ -9,7 +9,7 @@ repositories { } dependencies { - implementation platform("com.leakyabstractions:result-bom:0.2.0.1") + implementation platform("com.leakyabstractions:result-bom:0.3.2.0") implementation "com.leakyabstractions:result" } diff --git a/buildSrc/src/main/resources/jmh-visualizer.zip b/buildSrc/src/main/resources/jmh-visualizer.zip index 5320627..7597bcc 100644 Binary files a/buildSrc/src/main/resources/jmh-visualizer.zip and b/buildSrc/src/main/resources/jmh-visualizer.zip differ diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135..e644113 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 46671ac..381baa9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew.bat b/gradlew.bat index 93e3f59..25da30d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail