PyPI Unit test #1002
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
# SPDX-FileCopyrightText: 2016-2024 PyThaiNLP Project | |
# SPDX-License-Identifier: CC0-1.0 | |
name: PyPI Unit test | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Once per day | |
jobs: | |
pypi-test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
env: | |
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True | |
run: | | |
python -m pip install --upgrade "pip<24.1" setuptools | |
python -m pip install -r https://raw.githubusercontent.com/PyThaiNLP/pythainlp/dev/docker_requirements.txt | |
python -m pip install pythainlp[full] | |
python -m nltk.downloader omw-1.4 | |
- name: Test | |
run: | | |
mkdir pythainlp_test | |
cd pythainlp_test | |
pip download --no-binary=:all: --no-dependencies pythainlp | |
file="find . -name *.tar.gz" | |
file=$(eval "$file") | |
tar -xvzf $file --one-top-level | |
second="/" | |
path=${file//.tar.gz/$second} | |
cd $path | |
ls | |
cd tests | |
mkdir tests | |
mv data tests/ | |
python -m unittest discover |