Skip to content

Commit 516c4d6

Browse files
committed
ci(confidant): cross-platform test matrix for @elizaos/confidant
Adds a dedicated workflow that runs the package's vitest suite on ubuntu / macos / windows. The package's headline claim is that the OS-keyring credential mediation layer works the same on all three platforms; this workflow makes that claim verifiable in every PR that touches packages/confidant/**. Notes - Confidant installs standalone (`cd packages/confidant && bun install`) rather than going through the root workspace install. This keeps the CI run independent of which submodules are initialized in the checkout, and finishes in seconds rather than minutes. - On Linux, libsecret + gnome-keyring + dbus are installed and a session DBus + unlocked secret-service daemon are started so the real keyring round-trip tests run. Without those, the tests are designed to skip cleanly via a module-import-time probe — fail-open on hosts without a usable Secret Service. - The workflow is path-filtered to packages/confidant/** + the workflow file itself, so unrelated changes don't trigger it. - Both `develop` and `main` are listed as branches so the workflow runs for the standard elizaOS PR target.
1 parent 20dd6c4 commit 516c4d6

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: confidant-ci
2+
3+
# Cross-platform tests for @elizaos/confidant. The package's headline claim
4+
# is that the OS-keyring-backed credential mediation layer works the same
5+
# on macOS Keychain, Windows Credential Manager, and Linux Secret Service
6+
# (libsecret). This workflow makes that claim verifiable in CI on every PR
7+
# that touches the package.
8+
9+
concurrency:
10+
group: confidant-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
on:
14+
push:
15+
branches: [main, develop]
16+
paths:
17+
- "packages/confidant/**"
18+
- ".github/workflows/confidant-ci.yaml"
19+
pull_request:
20+
branches: [main, develop]
21+
paths:
22+
- "packages/confidant/**"
23+
- ".github/workflows/confidant-ci.yaml"
24+
25+
jobs:
26+
test:
27+
name: test (${{ matrix.os }})
28+
runs-on: ${{ matrix.os }}
29+
timeout-minutes: 15
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os: [ubuntu-latest, macos-latest, windows-latest]
34+
steps:
35+
- uses: actions/checkout@v6
36+
37+
- name: Setup Bun
38+
uses: oven-sh/setup-bun@v2
39+
with:
40+
bun-version: "1.3.13"
41+
42+
# Linux Secret Service prerequisites — without these the keyring
43+
# round-trip tests gate themselves OFF (the test design has a probe
44+
# at module-import time and `it.skipIf(!KEYRING_WORKS)` skips
45+
# cleanly). With these, the round-trip tests run.
46+
- name: Install Secret Service (Linux)
47+
if: matrix.os == 'ubuntu-latest'
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y libsecret-1-dev gnome-keyring dbus-x11
51+
# Start a session DBus + an unlocked gnome-keyring-daemon so the
52+
# libsecret backend can talk to a real Secret Service.
53+
eval "$(dbus-launch --sh-syntax)"
54+
echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" >> "$GITHUB_ENV"
55+
echo "DBUS_SESSION_BUS_PID=$DBUS_SESSION_BUS_PID" >> "$GITHUB_ENV"
56+
# Unlock the default keyring with an empty password so subsequent
57+
# secret writes don't block on a prompt.
58+
printf '\n' | gnome-keyring-daemon --unlock --components=secrets &
59+
sleep 1
60+
# Daemon prints its env vars; export them for downstream steps.
61+
eval "$(printf '\n' | gnome-keyring-daemon --start --components=secrets)"
62+
echo "GNOME_KEYRING_CONTROL=$GNOME_KEYRING_CONTROL" >> "$GITHUB_ENV"
63+
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> "$GITHUB_ENV"
64+
65+
- name: Install dependencies
66+
working-directory: packages/confidant
67+
run: bun install
68+
69+
- name: Typecheck
70+
working-directory: packages/confidant
71+
run: bun run typecheck
72+
73+
- name: Test
74+
working-directory: packages/confidant
75+
run: bun run test

0 commit comments

Comments
 (0)