Repository navigation
Merge branch 'master' of https://github.com/namanONcode/zThread #7
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
| name: Benchmark CI | |
| on: | |
| push: | |
| branches: [ main, master, develop ] | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| benchmark: | |
| name: Run Benchmarks & Update Graph | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install Python dependencies | |
| run: pip install matplotlib numpy | |
| - name: Build Benchmarks | |
| run: ./mvnw clean package -pl zthread-benchmark -am -DskipTests --batch-mode --no-transfer-progress | |
| - name: Run JMH Benchmarks | |
| run: java --enable-native-access=ALL-UNNAMED -XX:+UseZGC -Xmx2G -Xms2G -Djmh.ignoreLock=true -jar zthread-benchmark/target/benchmarks.jar -f 1 -wi 3 -i 5 ".*SpscEventBenchmark.*" -rf json -rff jmh-result.json | |
| - name: Generate Graph | |
| run: | | |
| mkdir -p assets | |
| python scripts/generate-graph.py | |
| - name: Commit and Push Graph | |
| if: github.event_name == 'push' | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add assets/benchmark_graph.svg | |
| git diff --staged --quiet || git commit -m "docs: auto-update benchmark graph [skip ci]" | |
| git push |