|
| 1 | +name: Regression |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + tags: ['*'] |
| 7 | + pull_request: |
| 8 | + schedule: |
| 9 | + - cron: '0 4 * * 6' # Run every Saturday |
| 10 | +concurrency: |
| 11 | + # Skip intermediate builds: always. |
| 12 | + # Cancel intermediate builds: only if it is a pull request build. |
| 13 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 14 | + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} |
| 15 | + |
| 16 | +jobs: |
| 17 | + test: |
| 18 | + name: Benchmarking ${{ matrix.description }} |
| 19 | + runs-on: ubuntu-latest |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + include: |
| 24 | + - {description: run, payload: benchmarks.jl } |
| 25 | + - {description: load, payload: load.jl } |
| 26 | + steps: |
| 27 | + # Remove older benchmark comment |
| 28 | + - name: pr-deleter |
| 29 | + uses: maheshrayas/[email protected] |
| 30 | + with: |
| 31 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 32 | + org: <orgname> |
| 33 | + repo: <repo> |
| 34 | + user: github-actions[bot] |
| 35 | + issue: ${{github.event.number}} |
| 36 | + |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + |
| 39 | + - name: Setup Julia stable |
| 40 | + uses: julia-actions/setup-julia@v1 |
| 41 | + with: |
| 42 | + version: '1.9' |
| 43 | + arch: x64 |
| 44 | + |
| 45 | + - uses: julia-actions/cache@v1 |
| 46 | + with: |
| 47 | + include-matrix: false |
| 48 | + - uses: julia-actions/julia-buildpkg@v1 |
| 49 | + |
| 50 | + - name: Install dependencies |
| 51 | + run: | |
| 52 | + julia --project=benchmark -e ' |
| 53 | + using Pkg |
| 54 | + Pkg.develop(PackageSpec(; path=pwd())) |
| 55 | + Pkg.instantiate()' |
| 56 | +
|
| 57 | + - name: Run benchmarks against master |
| 58 | + # Remove baseline once merged. Regression tests will only work after this is merged |
| 59 | + # in master. |
| 60 | + run: | |
| 61 | + julia --project=benchmark -e " |
| 62 | + using BenchmarkCI |
| 63 | + baseline = \"HEAD\" |
| 64 | + script = \"\$(pwd())/benchmark/${{ matrix.payload }}\" |
| 65 | + BenchmarkCI.judge(; baseline, script, retune=true)" |
| 66 | + if: ${{ github.event_name == 'pull_request' }} |
| 67 | + |
| 68 | + - name: Run benchmarks against last release |
| 69 | + run: | |
| 70 | + julia --project=benchmark -e " |
| 71 | + import Pkg |
| 72 | + baseline = \"v\" * Pkg.TOML.parsefile(\"Project.toml\")[\"version\"] |
| 73 | + script = \"\$(pwd())/benchmark/${{ matrix.payload }}\" |
| 74 | + using BenchmarkCI |
| 75 | + BenchmarkCI.judge(; baseline, script, retune=true)" |
| 76 | + if: ${{ github.event_name == 'schedule' || |
| 77 | + github.event.push.ref == 'refs/heads/master' }} |
| 78 | + |
| 79 | + - name: Print judgement |
| 80 | + run: | |
| 81 | + julia --project=benchmark -e ' |
| 82 | + using BenchmarkCI |
| 83 | + BenchmarkCI.displayjudgement()' |
| 84 | +
|
| 85 | + - name: Post results |
| 86 | + run: | |
| 87 | + julia --project=benchmark -e ' |
| 88 | + using BenchmarkCI |
| 89 | + BenchmarkCI.postjudge()' |
| 90 | + env: |
| 91 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 92 | + |
| 93 | + - name: Is report successful |
| 94 | + run: | |
| 95 | + res=$(julia --project=benchmark -e ' |
| 96 | + using BenchmarkCI |
| 97 | + BenchmarkCI.displayjudgement()' | grep --count ':x:') |
| 98 | + if [[ $res -gt 1 ]]; then exit 1; fi |
0 commit comments