From 2421a7f4923039184461cf272a473413cf018419 Mon Sep 17 00:00:00 2001 From: Nikolay Govorov Date: Sun, 22 Mar 2026 00:29:52 +0000 Subject: Eliminates unnecessary rebuilds on CI --- .forgejo/workflows/build.yml | 17 ++++++++++++++--- pkg/logo.svg | 2 +- tests/smoke/run-local.sh | 10 ++++------ 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index a9b3454..6bd6b89 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -30,8 +30,6 @@ jobs: - name: Check formatting run: cargo fmt --all --check - - name: Run clippy - run: cargo clippy --all-targets --all-features -- -D warnings build: name: Build (${{ matrix.arch }}) @@ -54,6 +52,7 @@ jobs: passphrase: ${{ secrets.GPG_PASSPHRASE }} gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + - run: cargo clippy --all-targets --all-features --release -- -D warnings - run: cargo build --release - run: cargo test --all-features --release --locked @@ -90,6 +89,11 @@ jobs: name: packages-${{ matrix.arch }} path: dist/* + - uses: https://code.forgejo.org/forgejo/upload-artifact@cb8afe72b42edc798abfb8fcb556cf660d894245 # v5 + with: + name: binary-${{ matrix.arch }} + path: target/release/recluse + smoke: name: Smoke tests runs-on: [ubuntu-24.04, x86_64] @@ -98,8 +102,15 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: https://code.forgejo.org/forgejo/download-artifact@1314311ddb542af343a82d478ac786ceada4143a # v5 + with: + name: binary-amd64 + path: target/release/ + - name: Run smoke tests against local instance - run: ./tests/smoke/run-local.sh + run: | + chmod +x target/release/recluse + ./tests/smoke/run-local.sh publish: name: Publish nightly build diff --git a/pkg/logo.svg b/pkg/logo.svg index 25cd3ec..4356e61 100644 --- a/pkg/logo.svg +++ b/pkg/logo.svg @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later - + diff --git a/tests/smoke/run-local.sh b/tests/smoke/run-local.sh index 32193dd..313890b 100755 --- a/tests/smoke/run-local.sh +++ b/tests/smoke/run-local.sh @@ -2,7 +2,8 @@ # SPDX-FileCopyrightText: 2026 Nikolay Govorov # SPDX-License-Identifier: AGPL-3.0-or-later -# Builds recluse, starts it in a temporary directory, runs smoke tests, cleans up. +# Starts recluse in a temporary directory, runs smoke tests, cleans up. +# Expects a prebuilt binary at target/release/recluse (run `cargo build --release` first). # # Usage: # ./tests/smoke/run-local.sh # default port 2025 @@ -10,6 +11,7 @@ set -euo pipefail +BIN="target/release/recluse" PORT="${RECLUSE_PORT:-2025}" BASE_URL="http://127.0.0.1:${PORT}" @@ -17,10 +19,6 @@ TMPDIR="$(mktemp -d)" LOGFILE="$TMPDIR/recluse.log" trap 'kill "$PID" 2>/dev/null; wait "$PID" 2>/dev/null; rm -rf "$TMPDIR"' EXIT -# Build -echo "Building recluse..." -cargo build --release -p recluse - # Write minimal config cat > "$TMPDIR/recluse.toml" <"$LOGFILE" 2>&1 & +"$BIN" --config="$TMPDIR/recluse.toml" >"$LOGFILE" 2>&1 & PID=$! # Wait for index to load (log shows "index refreshed" for each backend) -- Gilti