Skip to content

Commit 937d7ad

Browse files
committed
Make: Test & Publish JS
1 parent 641b8c0 commit 937d7ad

File tree

4 files changed

+52
-10
lines changed

4 files changed

+52
-10
lines changed

.github/workflows/prerelease.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ permissions:
1616
contents: read
1717

1818
jobs:
19+
1920
test_python:
2021
name: Test Python
2122
runs-on: ubuntu-latest
2223

2324
steps:
2425
- uses: actions/checkout@v4
25-
- run: git submodule update --init --recursive
2626
- name: Set up Python
2727
uses: actions/setup-python@v5
2828
with:
@@ -34,5 +34,21 @@ jobs:
3434
pip install -e ".[onnx]"
3535
pip install pytest
3636
37+
# When running tests in CI, limit ourselves to the small model tests
3738
- name: Test with PyTest
38-
run: pytest python/scripts/ -s -x -Wd -v
39+
run: pytest python/scripts/ -s -x -Wd -v -k small
40+
41+
test_javascript:
42+
name: Test JavaScript
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Set up Node.js
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: 20
51+
- name: Build JavaScript
52+
run: npm ci
53+
- name: Test JavaScript
54+
run: npm test

.github/workflows/release.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Run PyTest
7474
run: pytest python/scripts/
7575

76-
pypi_publish:
76+
publish_python:
7777
name: Publish Python
7878
runs-on: ubuntu-latest
7979
needs: versioning
@@ -101,13 +101,38 @@ jobs:
101101
user: __token__
102102
password: ${{ secrets.PYPI_API_TOKEN }}
103103

104+
publish_javascript:
105+
name: Publish JavaScript
106+
needs: versioning
107+
runs-on: ubuntu-22.04
108+
109+
steps:
110+
- uses: actions/checkout@v3
111+
with:
112+
ref: "main"
113+
114+
- name: Set up Node.js
115+
uses: actions/setup-node@v3
116+
with:
117+
node-version: 20
118+
119+
- name: Build and Test
120+
run: |
121+
npm ci
122+
npm test
123+
124+
- name: Publish
125+
uses: JS-DevTools/npm-publish@v2
126+
with:
127+
token: ${{ secrets.NPM_TOKEN }}
128+
104129
deploy_docs:
105130
name: Deploy Docs
106131
environment:
107132
name: github-pages
108133
url: ${{ steps.deployment.outputs.page_url }}
109134
runs-on: ubuntu-22.04
110-
needs: pypi_publish
135+
needs: [publish_python, publish_javascript]
111136
steps:
112137
- name: Checkout
113138
uses: actions/checkout@v4

.gitignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
requirements.txt
2-
dist/
3-
test
4-
build/
5-
package-lock.json
1+
/requirements.txt
2+
/dist/
3+
/test
4+
/build/
5+
/package-lock.json
66
*.egg-info
77
__pycache__
88
.build
@@ -11,6 +11,7 @@ __pycache__
1111

1212
dictionary*
1313
vocab*
14+
/models/
1415

1516
# Tensors & ML Model
1617
*.onnx

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Before submitting any changes, please make sure that the tests pass.
5050

5151
```sh
5252
npm install
53-
npm run test
53+
npm test
5454
```
5555

5656
## Benchmarking

0 commit comments

Comments
 (0)