Skip to content

Commit

Permalink
Merge pull request #95 from f4b6a3/feature_github_workflow_benchmark
Browse files Browse the repository at this point in the history
Add Github Workflow benchmark.yml
  • Loading branch information
fabiolimace authored Oct 15, 2023
2 parents 629a647 + 81e6922 commit f05590c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions benchmark/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f05590c

Please sign in to comment.