Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add perfomance check btwn master pr [2] #61

Merged
merged 3 commits into from
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ jobs:
run: cargo doc
- name: Move documentation
run: mkdir -p pages/doc && mv target/doc/* pages/doc/
- name: Get previous benchmark data
if: ${{ github.ref == 'refs/heads/master' }}
run: |
echo "Fetching gh-pages branch"
git fetch origin gh-pages

echo "Checking out gh-pages branch"
git checkout gh-pages

echo "Copying data file from gh-pages to cache"
mkdir -p pages/dev && cp -r dev/* pages/dev/ || { echo "Failed to copy dev folder" ; exit 1; }

echo "Checking out current previous branch"
git checkout -
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
Expand All @@ -55,6 +69,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 All @@ -63,7 +95,7 @@ jobs:
tool: 'cargo'
output-file-path: output.txt
summary-always: true
alert-threshold: "110%"
alert-threshold: "130%"
fail-on-alert: true
external-data-json-path: ./cache/benchmark-data.json
skip-fetch-gh-pages: "true"
Expand Down
Loading