Update tests.yml #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
env: | |
NLTK_DATA: ${{ secrets.NLTK_DATA }} | |
run: | | |
python -m unittest discover -s tests -p 'test_*.py' |