Skip to content

Commit 170bb3f

Browse files
Merge pull request #2 from GeoJSON-Net/feature/add-benchmarking
Feature/add benchmarking
2 parents 66db54e + c208f87 commit 170bb3f

62 files changed

Lines changed: 13476 additions & 17 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Run benchmark
2+
on:
3+
pull_request:
4+
branches: [ main ]
5+
6+
jobs:
7+
benchmark:
8+
name: Continuous benchmarking
9+
runs-on: ubuntu-latest
10+
11+
defaults:
12+
run:
13+
working-directory: ./src
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Setup .NET Core
18+
uses: actions/setup-dotnet@v1
19+
with:
20+
dotnet-version: |
21+
3.1.x
22+
5.0.x
23+
6.0.x
24+
# Run benchmark with `go test -bench` and stores the output to a file
25+
- name: Run benchmark
26+
run: dotnet run --project ./GeoJSON.Text.Test.Benchmark/GeoJSON.Text.Test.Benchmark.csproj --framework net6 --runtimes net60 -c Release -- --job short -f *SerializeAndDeserialize*
27+
# Download previous benchmark result from cache (if exists)
28+
- name: Download previous benchmark data
29+
uses: actions/cache@v1
30+
with:
31+
path: ./cache
32+
key: ${{ runner.os }}-benchmark
33+
# Run `github-action-benchmark` action
34+
- name: Store benchmark result for serialize feature collection
35+
uses: Happypig375/github-action-benchmark@v1
36+
with:
37+
# What benchmark tool the output.txt came from
38+
tool: 'benchmarkdotnet'
39+
# Where the output from the benchmark tool is stored
40+
output-file-path: 'src/BenchmarkDotNet.Artifacts/results/GeoJSON.Text.Test.Benchmark.SerializeAndDeserialize-report-full-compressed.json'
41+
# Where the previous data file is stored
42+
external-data-json-path: ./cache/benchmark-data.json
43+
# Will comment on pull request when an alert happens
44+
comment-always: true
45+
# GitHub API token to make a commit comment
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
# Upload the updated cache file for the next job by actions/cache
48+
# Run `github-action-benchmark` action

0 commit comments

Comments
 (0)