Skip to content

Commit

Permalink
Split build and benchmark workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
si618 committed Mar 11, 2024
1 parent d98a041 commit 35e2022
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 40 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: benchmark

on:
push:
branches:
- main

permissions:
deployments: write
contents: write

env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- name: 🚧 Checkout
uses: actions/checkout@main

- name: πŸ”¨ Setup dotnet
uses: actions/setup-dotnet@v4
with:
global-json-file: ./global.json

- name: 🎨 List benchmarks
id: list-benchmarks
run: |
dotnet run \
--project ./Benchmarks.App/Benchmarks.App.csproj \
--configuration Release \
list
- name: βš— Run benchmarks
id: run-benchmarks
run: |
dotnet run \
--project ./Benchmarks.App/Benchmarks.App.csproj \
--configuration Release \
workflow
- name: 🚚 Store benchmark results
id: store-benchmarks
if: ${{ github.event_name == 'push' }}
uses: benchmark-action/[email protected]
with:
name: Benchmarks
tool: benchmarkdotnet
output-file-path: BenchmarkDotNet.Artifacts/results/Benchmarks.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
41 changes: 1 addition & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Benchmark
name: build

on:
push:
Expand Down Expand Up @@ -30,42 +30,3 @@ jobs:
- name: 🎨 Run dotnet format
id: format
run: dotnet format --verbosity diagnostic --verify-no-changes --no-restore

benchmark:
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: 🚧 Checkout
uses: actions/checkout@main

- name: πŸ”¨ Setup dotnet
uses: actions/setup-dotnet@v4
with:
global-json-file: ./global.json

- name: 🎨 List benchmarks
id: list-benchmarks
run: |
dotnet run \
--project ./Benchmarks.App/Benchmarks.App.csproj \
--configuration Release \
list
- name: βš— Run benchmarks
id: run-benchmarks
run: |
dotnet run \
--project ./Benchmarks.App/Benchmarks.App.csproj \
--configuration Release \
workflow
- name: 🚚 Store benchmark results
id: store-benchmarks
if: ${{ github.event_name == 'push' }}
uses: benchmark-action/[email protected]
with:
name: Benchmarks
tool: benchmarkdotnet
output-file-path: BenchmarkDotNet.Artifacts/results/Benchmarks.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true

0 comments on commit 35e2022

Please sign in to comment.