Skip to content

Commit e80d5c3

Browse files
committed
Add JavaScript CI and release checks
1 parent 01f9f6c commit e80d5c3

2 files changed

Lines changed: 72 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
jobs:
10-
test:
10+
python:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
fail-fast: false
@@ -43,3 +43,42 @@ jobs:
4343

4444
- name: Check package metadata
4545
run: python -m twine check dist/*
46+
47+
javascript:
48+
runs-on: ubuntu-latest
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
node-version:
53+
- "20"
54+
55+
steps:
56+
- name: Check out repository
57+
uses: actions/checkout@v4
58+
59+
- name: Set up Node.js
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: ${{ matrix.node-version }}
63+
cache: npm
64+
cache-dependency-path: js/package-lock.json
65+
66+
- name: Install JS dependencies
67+
working-directory: js
68+
run: npm ci
69+
70+
- name: Run JS type checks
71+
working-directory: js
72+
run: npm run check
73+
74+
- name: Run JS tests
75+
working-directory: js
76+
run: npm run test
77+
78+
- name: Run JS live integration test
79+
working-directory: js
80+
run: SOURCEY_TEST_SITE_URL=https://sourcey.com/docs npm run test
81+
82+
- name: Build JS package
83+
working-directory: js
84+
run: npm run build

CONTRIBUTING.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,59 @@
22

33
## Local Setup
44

5+
Python:
6+
57
```bash
68
python3 -m venv .venv
79
. .venv/bin/activate
810
python -m pip install -U pip
911
python -m pip install -e .[dev] build twine
1012
```
1113

14+
JavaScript:
15+
16+
```bash
17+
cd js
18+
npm install
19+
```
20+
1221
## Test And Verify
1322

14-
Run the full local test suite:
23+
Run the Python test suite:
1524

1625
```bash
1726
PYTHONPATH=src pytest -q
1827
```
1928

20-
Run the live Sourcey integration test against a published docs site:
29+
Run the Python live Sourcey integration test against a published docs site:
2130

2231
```bash
2332
SOURCEY_TEST_SITE_URL=https://sourcey.com/docs PYTHONPATH=src pytest tests/integration_tests/test_live_retriever.py -q
2433
```
2534

26-
Build and validate the distribution artefacts:
35+
Build and validate the Python distribution artefacts:
2736

2837
```bash
2938
python -m build
3039
python -m twine check dist/*
3140
```
3241

42+
Run the JavaScript checks:
43+
44+
```bash
45+
cd js
46+
npm run check
47+
npm run test
48+
npm run build
49+
```
50+
51+
Run the JavaScript live Sourcey integration test:
52+
53+
```bash
54+
cd js
55+
SOURCEY_TEST_SITE_URL=https://sourcey.com/docs npm run test
56+
```
57+
3358
## Release Notes
3459

3560
- Keep `pyproject.toml` and `src/langchain_sourcey/retrievers.py` on the same
@@ -38,3 +63,7 @@ python -m twine check dist/*
3863
pass.
3964
- If package metadata changes, confirm the public repository and issue tracker
4065
URLs resolve before publishing.
66+
- Keep `js/package.json` and `js/src/retriever.ts` on the same package version
67+
so the JS `User-Agent` stays accurate.
68+
- Publish the JS package from `js/` only after `npm run check`, `npm run test`,
69+
the live JS test, and `npm run build` pass.

0 commit comments

Comments
 (0)