diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a26e225..5f285ed 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,3 +14,7 @@ updates: schedule: interval: weekly open-pull-requests-limit: 10 + - package-ecosystem: "nix" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml new file mode 100644 index 0000000..3a0390f --- /dev/null +++ b/.github/workflows/bench.yml @@ -0,0 +1,47 @@ + # Bencher regression detection. Requires: + # - BENCHER_API_TOKEN repo secret (https://bencher.dev/docs) + # - BENCHER_PROJECT repo variable (your Bencher project slug) + bench: + if: {% raw %}${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.BENCHER_PROJECT != '' }}{% endraw %} + runs-on: ubuntu-latest + steps: + - uses: {{ pin_github_action("actions/checkout", "v6") }} + with: + persist-credentials: false + - uses: dtolnay/rust-toolchain@stable + - uses: {{ pin_github_action("Swatinem/rust-cache", "v2") }} + with: + save-if: {% raw %}${{ github.ref == 'refs/heads/main' }}{% endraw %} + - uses: {{ pin_github_action("bencherdev/bencher", "v0") }} + - run: | + bencher run \ + --project {% raw %}${{ vars.BENCHER_PROJECT }}{% endraw %} \ + --token {% raw %}${{ secrets.BENCHER_API_TOKEN }}{% endraw %} \ + --branch main \ + --adapter rust_criterion \ + "cargo bench --all-features" + bench-pr: + if: {% raw %}${{ github.event_name == 'pull_request' && vars.BENCHER_PROJECT != '' }}{% endraw %} + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: {{ pin_github_action("actions/checkout", "v6") }} + with: + persist-credentials: false + - uses: dtolnay/rust-toolchain@stable + - uses: {{ pin_github_action("Swatinem/rust-cache", "v2") }} + with: + save-if: {% raw %}${{ github.ref == 'refs/heads/main' }}{% endraw %} + - uses: {{ pin_github_action("bencherdev/bencher", "v0") }} + - run: | + bencher run \ + --project {% raw %}${{ vars.BENCHER_PROJECT }}{% endraw %} \ + --token {% raw %}${{ secrets.BENCHER_API_TOKEN }}{% endraw %} \ + --branch {% raw %}${{ github.head_ref }}{% endraw %} \ + --start-point main \ + --start-point-reset \ + --adapter rust_criterion \ + --error-on-alert \ + --github-actions {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} \ + "cargo bench --all-features" diff --git a/flake.lock b/flake.lock index 246cfd4..bbfee60 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1774386573, - "narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=", + "lastModified": 1777268161, + "narHash": "sha256-bxrdOn8SCOv8tN4JbTF/TXq7kjo9ag4M+C8yzzIRYbE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9", + "rev": "1c3fe55ad329cbcb28471bb30f05c9827f724c76", "type": "github" }, "original": {