Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 11 additions & 9 deletions .github/actions/rust/pre-merge/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,6 @@ runs:
- name: Build and test with coverage
if: inputs.task == 'test'
run: |
# Start D-Bus and unlock keyring in the same shell that runs tests,
# so daemons are guaranteed alive for the entire test execution.
if [[ "$RUNNER_OS" == "Linux" ]]; then
eval $(dbus-launch --sh-syntax)
export DBUS_SESSION_BUS_ADDRESS
eval $(echo -n "test" | gnome-keyring-daemon --unlock --components=secrets)
echo -n "warmup" | secret-tool store --label="ci-warmup" ci-test warmup
fi

source <(cargo llvm-cov show-env --export-prefix)

bins_start=$(date +%s)
Expand All @@ -131,6 +122,17 @@ runs:
compile_duration=$((compile_end - compile_start))
echo "::notice::Tests compiled in ${compile_duration}s ($(date -ud @${compile_duration} +'%M:%S'))"

# Start D-Bus and unlock keyring right before test execution to avoid
# gnome-keyring auto-locking the collection during the build phase.
# Previously this ran before `cargo build`, leaving a 7+ minute idle
# window that triggered org.freedesktop.Secret.Error.IsLocked ~10% of runs.
if [[ "$RUNNER_OS" == "Linux" ]]; then
eval $(dbus-launch --sh-syntax)
export DBUS_SESSION_BUS_ADDRESS
eval $(echo -n "test" | gnome-keyring-daemon --unlock --components=secrets)
echo -n "warmup" | secret-tool store --label="ci-warmup" ci-test warmup
fi

test_start=$(date +%s)
if command -v cargo-nextest &> /dev/null; then
cargo nextest run --locked --no-fail-fast
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,19 @@ jobs:

- name: Build and test with coverage
run: |
# Start D-Bus and unlock keyring in the same shell that runs tests,
# so daemons are guaranteed alive for the entire test execution.
source <(cargo llvm-cov show-env --export-prefix)
cargo build --locked
cargo test --locked --no-run

# Start D-Bus and unlock keyring right before test execution to avoid
# gnome-keyring auto-locking the collection during the build phase.
# Previously this ran before `cargo build`, leaving a 7+ minute idle
# window that triggered org.freedesktop.Secret.Error.IsLocked ~10% of runs.
eval $(dbus-launch --sh-syntax)
export DBUS_SESSION_BUS_ADDRESS
eval $(echo -n "test" | gnome-keyring-daemon --unlock --components=secrets)
echo -n "warmup" | secret-tool store --label="ci-warmup" ci-test warmup

source <(cargo llvm-cov show-env --export-prefix)
cargo build --locked
cargo test --locked --no-run
if command -v cargo-nextest &> /dev/null; then
cargo nextest run --locked --no-fail-fast
else
Expand Down
Loading