Test JSOBenchmarks with SolverBenchmarks: try non-forked branches #72
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: JSOBenchmarks | |
| on: | |
| pull_request: | |
| types: [labeled, opened, synchronize, reopened] | |
| workflow_call: | |
| jobs: | |
| bmark: | |
| name: Julia ${{ matrix.version }} - macOS - ${{ matrix.arch }} - ${{ github.event_name }} | |
| if: github.event_name == 'workflow_call' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run benchmarks')) | |
| # FIXME: should run on hosted runner | |
| runs-on: macOS-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: | |
| - 1 | |
| arch: | |
| - aarch64 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.version }} | |
| arch: ${{ matrix.arch }} | |
| - uses: julia-actions/cache@v2 | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| # FIXME: register JSOBenchmarks | |
| - name: Installing non-registered dependencies | |
| run: | | |
| using Pkg | |
| pkg1 = PackageSpec(url = "https://github.com/MaxenceGollier/JSOBenchmarks.jl.git", rev = "solver_benchmarks") | |
| pkg2 = PackageSpec(url = "https://github.com/MaxenceGollier/SolverBenchmark.jl.git", rev = "switch-getters") | |
| pkg3 = PackageSpec(url = "https://github.com/MaxenceGollier/RegularizedProblems.jl.git", rev = "fix-qp-rand") | |
| pkg_list = [pkg1, pkg2, pkg3] | |
| Pkg.add(pkg_list) | |
| shell: julia --project=benchmark --color=yes {0} | |
| - name: Install benchmark dependencies | |
| run: julia --project=benchmark -e 'using Pkg; Pkg.instantiate()' | |
| - name: Sanitize project name | |
| id: sanitize | |
| run: echo "REPONAME=${{ github.event.repository.name }}" | sed -e 's/\.jl$//' >> $GITHUB_OUTPUT | |
| - name: Run benchmarks | |
| run: julia --project=benchmark -e ' | |
| using JSOBenchmarks | |
| gist_url = run_benchmarks( | |
| "${{ steps.sanitize.outputs.REPONAME }}", | |
| "benchmark", | |
| reference_branch = "origin/${{ github.event.pull_request.base.ref }}", | |
| ) | |
| run_solver_benchmarks( | |
| "${{ steps.sanitize.outputs.REPONAME }}", | |
| "benchmark", | |
| reference_branch = "origin/${{ github.event.pull_request.base.ref }}", | |
| gist_url = gist_url, | |
| script = "solver_benchmarks.jl", | |
| ) | |
| ' | |
| env: | |
| GITHUB_AUTH: ${{ secrets.GIST_TOKEN }} | |
| - name: Build comment | |
| id: build-comment | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ github.token }} | |
| result-encoding: string | |
| script: | | |
| const fs = require('fs'); | |
| return fs.readFileSync("${{ github.workspace }}/bmark_${{ github.sha }}.md", "utf8").toString(); | |
| - name: Comment in PR | |
| uses: thollander/actions-comment-pull-request@v2 | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| message: ${{ steps.build-comment.outputs.result }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: jso-benchmarks | |
| path: | | |
| profiles_this_commit_vs_reference_*.svg | |
| profiles_this_commit_vs_reference_*.pdf | |
| *_vs_reference_*.jld2 | |
| bmark_*.md | |
| reference.md | |
| judgement_*.md | |
| *_solver_benchmarks_*.jld2 | |
| reference_*.tex | |
| this_commit_*.tex |