Skip to content

Commit

Permalink
Try to add cache to benchmarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Sep 13, 2023
1 parent 03a2e5e commit 58b8609
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
run: python3 ./tools/metacall-benchmarks-merge.py ./build/benchmarks

# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v1
if: ${{ github.event_name != 'pull_request' }}
with:
path: ./cache
key: ${{ matrix.os }}-benchmark

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
if: ${{ github.event_name != 'pull_request' }}
Expand All @@ -82,6 +90,8 @@ jobs:
gh-pages-branch: ${{ github.head_ref || github.ref_name }}
# Output directory
benchmark-data-dir-path: bench/${{ matrix.os }}
# Where the previous data file is stored
external-data-json-path: ./cache/metacall-benchmarks.json

# Upload benchmark artifacts
- name: Upload benchmark artifact
Expand Down Expand Up @@ -140,6 +150,14 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
run: python3 ./tools/metacall-benchmarks-merge.py ./build/benchmarks

# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v1
if: ${{ github.event_name != 'pull_request' }}
with:
path: ./cache
key: ${{ matrix.os }}-benchmark

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
if: ${{ github.event_name != 'pull_request' }}
Expand All @@ -156,6 +174,8 @@ jobs:
gh-pages-branch: ${{ github.head_ref || github.ref_name }}
# Output directory
benchmark-data-dir-path: bench/${{ matrix.os }}
# Where the previous data file is stored
external-data-json-path: ./cache/metacall-benchmarks.json

# Upload benchmark artifacts
- name: Upload benchmark artifact
Expand Down

0 comments on commit 58b8609

Please sign in to comment.