Skip to content

Commit

Permalink
github: action: Load cache from previous benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulTrombin committed Nov 8, 2023
1 parent 99979b1 commit 04325e5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@ jobs:
with:
prefix-key: "rust-cache"
shared-key: "benchmark"
- name: Get previous benchmark data
run: |
echo "Fetching gh-pages branch"
git fetch origin gh-pages
echo "Checking out gh-pages branch"
git checkout gh-pages
if [ ! -d "cache" ]; then
echo "Cache folder does not exist, creating it"
mkdir cache
fi
echo "Copying data file from gh-pages to cache"
cp dev/cache/benchmark-data.json cache/benchmark-data.json || { echo "Failed to copy data file" ; exit 1; }
echo "Checking out current preivous branch"
git checkout -
- name: Cargo Bench
run: cargo bench --jobs 1 --bench bench -- --output-format bencher | tee output.txt
- name: Compare results & store cached results
Expand Down

0 comments on commit 04325e5

Please sign in to comment.