From 38382b2dc7dfc3fea85844eef8e66e43b228b118 Mon Sep 17 00:00:00 2001 From: Raul Victor Trombin Date: Mon, 6 Nov 2023 15:03:04 -0300 Subject: [PATCH 1/2] github: action: docs: Minor correction for linter --- .github/workflows/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index eb5bdf2b49..e5dcbe5458 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -50,7 +50,7 @@ jobs: steps: - name: Checkout to repository uses: actions/checkout@v2 - - name: Setup Rust toolchain + - name: Setup Rust toolchain uses: actions-rs/toolchain@v1.0.7 with: toolchain: stable @@ -59,7 +59,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 From c4eb1bea954e90b60e3c66d5b61d9a6b0b3d138a Mon Sep 17 00:00:00 2001 From: Raul Victor Trombin Date: Mon, 6 Nov 2023 15:04:36 -0300 Subject: [PATCH 2/2] github: action: Save cache data to gh-page --- .github/workflows/action.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index e5dcbe5458..a9dbbbbfdb 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -43,6 +43,52 @@ 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/github-action-benchmark@v1.18.0 + 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 "actions@github.com" + + 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