Skip to content

Commit 4a935f8

Browse files
committed
chore: add tests and release automation
1 parent ab4d445 commit 4a935f8

30 files changed

Lines changed: 1921 additions & 74 deletions

.github/workflows/checks.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,11 @@ jobs:
3535
- name: Biome check
3636
run: bun run check
3737

38+
- name: Unit tests
39+
run: bun test tests/unit
40+
41+
- name: API tests
42+
run: bun test tests/api
43+
3844
- name: Build
3945
run: bun run build

.github/workflows/e2e.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: E2E CI
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
push:
9+
10+
concurrency:
11+
group: e2e-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
e2e:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 25
18+
steps:
19+
- name: Checkout
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup Bun
23+
uses: oven-sh/setup-bun@v2
24+
with:
25+
bun-version: latest
26+
27+
- name: Install dependencies
28+
run: bun install
29+
30+
- name: Install Playwright browsers
31+
run: bunx playwright install --with-deps chromium
32+
33+
- name: Run E2E tests
34+
run: bun run test:e2e
35+
36+
- name: Upload Playwright HTML report (on failure)
37+
if: failure()
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: playwright-report
41+
path: playwright-report
42+
if-no-files-found: ignore
43+
44+
- name: Upload Playwright traces (on failure)
45+
if: failure()
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: test-results
49+
path: test-results
50+
if-no-files-found: ignore

.github/workflows/release-please.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: release-${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Setup Bun
26+
uses: oven-sh/setup-bun@v2
27+
with:
28+
bun-version: latest
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '22'
34+
registry-url: 'https://registry.npmjs.org'
35+
36+
- name: Install dependencies
37+
run: bun install --frozen-lockfile
38+
39+
- name: Build
40+
run: bun run build
41+
42+
- name: Release
43+
run: npx semantic-release
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.releaserc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/npm",
7+
"@semantic-release/github"
8+
]
9+
}

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ bun run build
8383

8484
`~/.config/agenttrail/config.json`
8585

86+
You can override the config location by setting `AGENTTRAIL_CONFIG` to a custom path (useful for testing or isolated instances).
87+
8688
On first run, if the config file does not exist, AgentTrail creates it and adds a default directory:
8789
`~/.claude/projects`.
8890

@@ -137,6 +139,10 @@ bun run dev
137139
# typecheck
138140
bun run typecheck
139141

142+
# tests
143+
bun test
144+
bunx playwright test
145+
140146
# lint/format (Biome)
141147
bun run check
142148
bun run format
@@ -160,10 +166,7 @@ Contributions are welcome!
160166

161167
## Publishing
162168

163-
This repository is set up to publish to npm via GitHub Actions using the same pattern as `datadog-cli`:
164-
165-
- `.github/workflows/release-please.yml` opens a release PR (version bump + changelog) using conventional commits.
166-
- When a release is created (or via manual dispatch), it publishes to npm.
169+
This repository is set up to publish to npm via GitHub Actions using **semantic-release**.
167170

168171
To enable publishing:
169172

SPEC.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ In-app settings management:
104104
~/.config/agenttrail/config.json
105105
```
106106

107+
You can override the config location by setting `AGENTTRAIL_CONFIG` to a custom path. This is useful for testing or running multiple isolated instances.
108+
107109
### Config Schema
108110

109111
```typescript
@@ -510,6 +512,9 @@ bun run build
510512
### Testing
511513

512514
```bash
513-
# Run tests (future)
514515
bun test
516+
bun test tests/unit
517+
bun test tests/api
518+
bunx playwright install chromium
519+
bunx playwright test
515520
```

0 commit comments

Comments
 (0)