From c138eeae07917775d888676bcb30d936a0aab969 Mon Sep 17 00:00:00 2001 From: Ryan Kierulf Date: Thu, 27 Jun 2024 18:18:07 -0500 Subject: [PATCH] Add github action --- .github/workflows/Benchmark.yml | 64 +++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/Benchmark.yml diff --git a/.github/workflows/Benchmark.yml b/.github/workflows/Benchmark.yml new file mode 100644 index 000000000..9e76d1608 --- /dev/null +++ b/.github/workflows/Benchmark.yml @@ -0,0 +1,64 @@ +name: Benchmarks +on: + pull_request: + branches: + - main + paths: + - "KomaMRICore/src/**/*" + - "KomaMRICore/ext/**/*" + - "KomaMRICore/Project.toml" + - "KomaMRIBase/src/**/*" + - "KomaMRIBase/Project.toml" + - "bench/**/*" + - ".buildkite/**/*" + - "Project.toml" + push: + branches: + - main + - benchmark #TO-DO: remove this + paths: + - "KomaMRICore/src/**/*" + - "KomaMRICore/ext/**/*" + - "KomaMRICore/Project.toml" + - "KomaMRIBase/src/**/*" + - "KomaMRIBase/Project.toml" + - "bench/**/*" + - ".buildkite/**/*" + - "Project.toml" + +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - name: Download Buildkite Artifacts + id: download + uses: EnricoMi/download-buildkite-artifact-action@v1 + with: + buildkite_token: ${{ secrets.BUILDKITE_TOKEN }} + ignore_build_states: blocked,canceled,skipped,not_run,failed + ignore_job_states: timed_out,failed + output_path: artifacts + log_level: DEBUG #TO-DO: remove this + permissions: + metadata: read + contents: read + statuses: read + + - name: Locate Benchmarks Artifact + id: locate + if: ${{ steps.download.download_state == success}} + run: echo "path=$(find artifacts -type f -name combinedbenchmarks.json)" >> $GITHUB_OUTPUT + + + - name: Upload Benchmark Results + if: ${{ steps.download.download_state == success && steps.locate.path != '' }} + uses: benchmark-action/github-action-benchmark@v1 + name: KomaMRI Benchmarks + tool: 'julia' + output-file-path: ${{ steps.locate.path }} + summary-always: true + github-token: ${{ secrets.GITHUB_TOKEN }} + comment-always: true + alert-threshold: "150%" + fail-on-alert: false + auto-push: ${{ github.event_name != 'pull_request' }}