From 457269a73bad53337fddb221eccf555362cba0d1 Mon Sep 17 00:00:00 2001 From: Ben Sully Date: Tue, 14 Jan 2025 12:40:49 +0000 Subject: [PATCH] tests: run benchmarks in separate CI check (#238) --- .github/workflows/rust.yml | 17 +++++++++++++++++ justfile | 13 ++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bdede2b..78deaa1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -45,6 +45,23 @@ jobs: - name: Run doc tests run: just doctest + bench: + name: Run benchmarks + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: moonrepo/setup-rust@v1 + with: + bins: cargo-nextest,just + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run benchmarks in test mode + run: just test-bench + test-book: name: Test Book runs-on: ubuntu-latest diff --git a/justfile b/justfile index 53ecdbc..04aac91 100644 --- a/justfile +++ b/justfile @@ -19,7 +19,7 @@ test: --exclude *-js \ --exclude pyaugurs -# Run all unit and integration tests, plus examples and benchmarks, except for those which require `iai` (which isn't available on all platforms) and the Prophet benchmarks which require a STAN installation. +# Run all unit and integration tests, plus examples, except for those which require `iai` (which isn't available on all platforms) and the Prophet benchmarks which require a STAN installation. test-all: cargo nextest run \ --all-features \ @@ -27,6 +27,17 @@ test-all: --workspace \ --exclude *-js \ --exclude pyaugurs \ + -E 'not (binary(/iai/) | binary(/prophet-cmdstan/) | kind(bench))' + +# Run benchmarks in "test mode" (but with optimizations) using nextest. +test-bench: + cargo nextest run \ + --release \ + --all-features \ + --benches \ + --workspace \ + --exclude *-js \ + --exclude pyaugurs \ -E 'not (binary(/iai/) | binary(/prophet-cmdstan/))' doctest: