Add SJF4J #33
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'releases/*' | |
| pull_request: | |
| branches: | |
| - '*' | |
| env: | |
| JAVA_VERSION: '17' | |
| jobs: | |
| linux: | |
| name: 'Linux (JDK 17)' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4.1.1 | |
| - name: Set up JDK ${{ env.JAVA_VERSION }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: 'adopt' | |
| cache: maven | |
| - name: 'Test' | |
| shell: bash | |
| run: ./mvnw clean install | |
| benchmark: | |
| name: ${{ matrix.mapper }} Benchmark | |
| needs: linux | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| mapper: [Manual, MapStruct, Selma, JMapper, datus, Orika, ModelMapper, BULL, Dozer, ReMap, SJF4J] | |
| steps: | |
| - uses: actions/checkout@v4.1.1 | |
| - name: Set up JDK ${{ env.JAVA_VERSION }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: 'adopt' | |
| cache: maven | |
| - name: 'Install' | |
| shell: bash | |
| run: ./mvnw clean install -DskipTests | |
| - name: 'Benchmark' | |
| shell: bash | |
| run: java -jar target/benchmarks.jar -p type=${{ matrix.mapper }} -rff results_${{ matrix.mapper }}.csv -rf csv | |
| - uses: actions/upload-artifact@v4 | |
| name: Upload Benchmark Results | |
| with: | |
| name: benchmark_results_${{ matrix.mapper }} | |
| path: results_${{ matrix.mapper }}.csv | |
| collect_benchmark: | |
| name: Collect benchmarks | |
| needs: benchmark | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4.1.1 | |
| - uses: actions/download-artifact@v4.1.8 | |
| name: Download benchmarks | |
| with: | |
| pattern: benchmark_results_* | |
| merge-multiple: true | |
| - shell: bash | |
| name: Prepare CSV Results | |
| run: | | |
| head -1 results_Manual.csv > results.csv | |
| for mapper in Manual MapStruct Selma JMapper datus Orika ModelMapper BULL Dozer ReMap SJF4J; do sed 1d results_${mapper}.csv >> results.csv; done | |
| less results.csv | |
| - uses: actions/upload-artifact@v4 | |
| name: Upload CSV Results | |
| with: | |
| name: results-csv | |
| path: results.csv | |
| - shell: bash | |
| name: Install gnuplot | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install gnuplot | |
| - shell: bash | |
| name: Plot Results | |
| run: | | |
| gnuplot -c benchmark.plt | |
| - uses: actions/upload-artifact@v4 | |
| name: Upload Plot | |
| with: | |
| name: results-plot | |
| path: results.png |