diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 00000000..462941a6 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,29 @@ + +name: Benchmark with JMH + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + java_version: ['8', '21'] + os: ['ubuntu-22.04'] + + steps: + - name: Checkout on ${{ matrix.os }} + uses: actions/checkout@v3 + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java_version }} + distribution: 'temurin' + cache: maven + - name: Run Benchmark + run: benchmark/run.sh diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 419e8caf..d58bccc9 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - java_version: ['8', '11', '17'] + java_version: ['8', '21'] os: ['ubuntu-22.04', 'windows-2022', 'macos-12'] steps: diff --git a/benchmark/run.sh b/benchmark/run.sh index 2f4f273a..c48822e0 100755 --- a/benchmark/run.sh +++ b/benchmark/run.sh @@ -9,7 +9,7 @@ SCRIPT_DIR=$(dirname "$0") cd "${SCRIPT_DIR}/.." # compile the parent project -mvn clean install -DskipTests +mvn --batch-mode --quiet --fail-fast clean install -DskipTests # create a copy with the expected name cp "${PWD}/target/${ARTIFACT_ID}"-*-SNAPSHOT.jar "${PWD}/target/${ARTIFACT_ID}"-0.0.1-BENCHMARK.jar @@ -18,8 +18,8 @@ cp "${PWD}/target/${ARTIFACT_ID}"-*-SNAPSHOT.jar "${PWD}/target/${ARTIFACT_ID}"- cd benchmark # compile the benchmark project -mvn validate -mvn clean install +mvn --batch-mode --quiet --fail-fast validate +mvn --batch-mode --quiet --fail-fast clean install # run the benchmark java -jar target/benchmarks.jar