Dependabot benchmark and doc ignores, reorganize what action is run when #1042
Workflow file for this run
This file contains 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: Benchmarks | |
on: | |
pull_request: | |
branches-ignore: | |
- 'doc/**' | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: 1 | |
- uses: julia-actions/cache@v1 | |
- uses: julia-actions/julia-buildpkg@v1 | |
- name: Install dependencies | |
run: julia -e 'using Pkg; pkg"add PkgBenchmark BenchmarkTools BenchmarkCI@0.1"' | |
- name: Run benchmarks | |
run: julia -e 'using BenchmarkCI; BenchmarkCI.judge(baseline="origin/develop"); BenchmarkCI.displayjudgement()' | |
# generate result markdown | |
- name: generate benchmark result | |
id: generate-result-markdown | |
run: | | |
body=$(julia -tauto -e ' | |
using BenchmarkCI | |
let | |
judgement = BenchmarkCI._loadjudge(BenchmarkCI.DEFAULT_WORKSPACE) | |
title = "Benchmark result" | |
ciresult = BenchmarkCI.CIResult(; judgement, title) | |
BenchmarkCI.printcommentmd(stdout::IO, ciresult) | |
end | |
') | |
body="${body//'%'/'%25'}" | |
body="${body//$'\n'/'%0A'}" | |
body="${body//$'\r'/'%0D'}" | |
echo ::set-output name=body::$body | |
# check if the previous comment exists | |
- name: find comment | |
uses: peter-evans/find-comment@v1 | |
id: fc | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: Benchmark result | |
# create/update comment | |
- name: create comment | |
if: ${{ steps.fc.outputs.comment-id == 0 }} && github.actor != 'dependabot[bot]' | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
body: ${{ steps.generate-result-markdown.outputs.body }} | |
- name: update comment | |
if: ${{ steps.fc.outputs.comment-id != 0 }} && github.actor != 'dependabot[bot]' | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
body: ${{ steps.generate-result-markdown.outputs.body }} |