Skip to content

Update tests.yml

Update tests.yml #10

Workflow file for this run

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'