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 [1] #58

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
50 changes: 48 additions & 2 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,60 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./pages

bench:
needs: build
runs-on: raspbian-armv7-kernel-5.10.33
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@stable
- name: Rust | Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "rust-cache"
shared-key: "benchmark"
- name: Cargo Bench
run: cargo bench --jobs 1 --bench bench -- --output-format bencher | tee output.txt
- name: Compare results & store cached results
uses: benchmark-action/[email protected]
with:
tool: 'cargo'
output-file-path: output.txt
summary-always: true
alert-threshold: "110%"
fail-on-alert: true
external-data-json-path: ./cache/benchmark-data.json
skip-fetch-gh-pages: "true"
- name: Update data file
if: ${{ github.ref == 'refs/heads/master' }}
run: |
git config user.name "GitHub Actions Bot"
git config user.email "[email protected]"

git fetch origin gh-pages

git checkout gh-pages

if [ ! -d "dev/cache" ]; then
echo "Cache folder does not exist, creating it"
mkdir -p dev/cache
fi

cp cache/benchmark-data.json dev/cache/benchmark-data.json

tree cache

git add dev/cache/benchmark-data.json
git commit -m "Update benchmark-data file"
git push origin gh-pages

deploy:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout to repository
uses: actions/checkout@v2
- name: Setup Rust toolchain
- name: Setup Rust toolchain
uses: actions-rs/[email protected]
with:
toolchain: stable
Expand All @@ -59,7 +105,7 @@ jobs:
run: cargo install cargo-bump --force
- name: Modify version with tag
run: cargo bump ${{ github.ref_name }}
- name: Automatic commit for crate version upgrade
- name: Automatic commit for crate version upgrade
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: master
Expand Down
Loading