Skip to content

Commit 34996a0

Browse files
authored
Feature/unit test (#25)
* Create unit-test.yml init for unit test * + add dependency on pybind11 for unit test * + add pyproject.toml * * use fasttext-wheel instead of fasttext * - remove extra toml file * * open the cache for pip * * set unique pip cache wildcard patterns * + add caches for assets and models * * use cache of v3
1 parent 99ef53b commit 34996a0

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.github/workflows/unit-test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Unit Test
5+
6+
on: [push, pull_request, workflow_dispatch]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Cache data-juicer assets and models
19+
uses: actions/cache@v3
20+
with:
21+
path: ~/.cache/data_juicer
22+
key: dj-assets-models
23+
- name: Set up Python 3.8
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: "3.8"
27+
cache: 'pip'
28+
cache-dependency-path: 'environments/**_requires.txt'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -v -e .[all]
33+
- name: Run the test
34+
run: |
35+
python tests/run.py

environments/science_requires.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fasttext
1+
fasttext-wheel
22
kenlm
33
sentencepiece
44
scipy

0 commit comments

Comments
 (0)