-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (39 loc) · 1.14 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Unit Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Download NLTK data
run: python -m nltk.downloader punkt averaged_perceptron_tagger
- name: Wait for NLTK data to be downloaded
run: |
count=0
while [ ! -f /home/runner/nltk_data/tokenizers/punkt/english.pickle ] || [ ! -f /home/runner/nltk_data/taggers/averaged_perceptron_tagger/averaged_perceptron_tagger.pickle ]; do
echo "Waiting for NLTK data to be downloaded..."
sleep 10
count=$((count+10))
if [ $count -gt 60 ]; then
echo "NLTK data download timeout exceeded!"
exit 1
fi
done
- name: Run unit tests
run: |
python -m unittest discover -s tests -p 'test_*.py'