Skip to content

Settings: 1. Update Settings - Files - Miscellaneous Settings - Read … #1578

Settings: 1. Update Settings - Files - Miscellaneous Settings - Read …

Settings: 1. Update Settings - Files - Miscellaneous Settings - Read … #1578

Workflow file for this run

# ----------------------------------------------------------------------
# Tests: CI - GitHub Actions
# Copyright (C) 2018-2025 Ye Lei (叶磊)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# ----------------------------------------------------------------------
name: Tests
on: [push, pull_request]
jobs:
# Windows
build-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: 'requirements/requirements_tests.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --requirement requirements/requirements_tests.txt
# For Codecov
pip install pytest-cov
# Download models and data files
python utils/wl_download_ci.py
python utils/wl_download_modern_botok.py
python utils/wl_download_pkuseg.py
- name: Run Tests and collect coverage
run: |
# Run some tests separately to reduce memory usage
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/tests_spacy/test_spacy_eng.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/tests_spacy/test_spacy_misc.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/tests_stanza/test_stanza_eng.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/tests_stanza/test_stanza_misc.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_dependency_parsing.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_lemmatization.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_matching.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_nlp_utils.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_pos_tagging.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_sentence_tokenization.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_sentiment_analysis.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_stop_word_lists.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_syl_tokenization.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_texts.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_token_processing.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_word_detokenization.py
pytest --cov=./ --cov-report=xml --cov-append tests/tests_nlp/test_word_tokenization.py
pytest --cov=./ --cov-report=xml --cov-append tests/test_colligation_extractor.py
pytest --cov=./ --cov-report=xml --cov-append tests/test_collocation_extractor.py
pytest --cov=./ --cov-report=xml --cov-append tests/test_concordancer.py
pytest --cov=./ --cov-report=xml --cov-append tests/test_concordancer_parallel.py
pytest --cov=./ --cov-report=xml --cov-append tests/test_dependency_parser.py
pytest --cov=./ --cov-report=xml --cov-append tests/test_keyword_extractor.py
pytest --cov=./ --cov-report=xml --cov-append tests/test_main.py
pytest --cov=./ --cov-report=xml --cov-append tests/test_ngram_generator.py
pytest --cov=./ --cov-report=xml --cov-append tests/test_profiler.py
pytest --cov=./ --cov-report=xml --cov-append tests/test_wordlist_generator.py
pytest --cov=./ --cov-report=xml --cov-append --ignore=tests/tests_nlp --ignore=tests/test_colligation_extractor.py --ignore=tests/test_collocation_extractor.py --ignore=tests/test_concordancer.py --ignore=tests/test_concordancer_parallel.py --ignore=tests/test_dependency_parser.py --ignore=tests/test_keyword_extractor.py --ignore=tests/test_main.py --ignore=tests/test_ngram_generator.py --ignore=tests/test_profiler.py --ignore=tests/test_wordlist_generator.py
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# macOS
build-macos:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: 'requirements/requirements_tests.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --requirement requirements/requirements_tests_macos.txt
# Download models and data files
python utils/wl_download_ci.py
python utils/wl_download_modern_botok.py
python utils/wl_download_pkuseg.py
- name: Run Tests
run: |
# Run some tests separately to reduce memory usage
pytest tests/tests_nlp/tests_spacy/test_spacy_eng.py
pytest tests/tests_nlp/tests_spacy/test_spacy_misc.py
pytest tests/tests_nlp/tests_stanza/test_stanza_eng.py
pytest tests/tests_nlp/tests_stanza/test_stanza_misc.py
pytest tests/tests_nlp/test_dependency_parsing.py
pytest tests/tests_nlp/test_lemmatization.py
pytest tests/tests_nlp/test_matching.py
pytest tests/tests_nlp/test_nlp_utils.py
pytest tests/tests_nlp/test_pos_tagging.py
pytest tests/tests_nlp/test_sentence_tokenization.py
pytest tests/tests_nlp/test_sentiment_analysis.py
pytest tests/tests_nlp/test_stop_word_lists.py
pytest tests/tests_nlp/test_syl_tokenization.py
pytest tests/tests_nlp/test_texts.py
pytest tests/tests_nlp/test_token_processing.py
pytest tests/tests_nlp/test_word_detokenization.py
pytest tests/tests_nlp/test_word_tokenization.py
pytest tests/test_colligation_extractor.py
pytest tests/test_collocation_extractor.py
pytest tests/test_concordancer.py
pytest tests/test_concordancer_parallel.py
pytest tests/test_dependency_parser.py
pytest tests/test_keyword_extractor.py
pytest tests/test_main.py
pytest tests/test_ngram_generator.py
pytest tests/test_profiler.py
pytest tests/test_wordlist_generator.py
pytest --ignore=tests/tests_nlp --ignore=tests/test_colligation_extractor.py --ignore=tests/test_collocation_extractor.py --ignore=tests/test_concordancer.py --ignore=tests/test_concordancer_parallel.py --ignore=tests/test_dependency_parser.py --ignore=tests/test_keyword_extractor.py --ignore=tests/test_main.py --ignore=tests/test_ngram_generator.py --ignore=tests/test_profiler.py --ignore=tests/test_wordlist_generator.py
# Linux
build-linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: 'requirements/requirements_tests.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --requirement requirements/requirements_tests.txt
# Download models and data files
python utils/wl_download_ci.py
python utils/wl_download_modern_botok.py
python utils/wl_download_pkuseg.py
- name: Run Tests
run: |
# Fix PyQt
export QT_QPA_PLATFORM=offscreen
# Run some tests separately to reduce memory usage
pytest tests/tests_nlp/tests_spacy/test_spacy_eng.py
pytest tests/tests_nlp/tests_spacy/test_spacy_misc.py
pytest tests/tests_nlp/tests_stanza/test_stanza_eng.py
pytest tests/tests_nlp/tests_stanza/test_stanza_misc.py
pytest tests/tests_nlp/test_dependency_parsing.py
pytest tests/tests_nlp/test_lemmatization.py
pytest tests/tests_nlp/test_matching.py
pytest tests/tests_nlp/test_nlp_utils.py
pytest tests/tests_nlp/test_pos_tagging.py
pytest tests/tests_nlp/test_sentence_tokenization.py
pytest tests/tests_nlp/test_sentiment_analysis.py
pytest tests/tests_nlp/test_stop_word_lists.py
pytest tests/tests_nlp/test_syl_tokenization.py
pytest tests/tests_nlp/test_texts.py
pytest tests/tests_nlp/test_token_processing.py
pytest tests/tests_nlp/test_word_detokenization.py
pytest tests/tests_nlp/test_word_tokenization.py
pytest tests/test_colligation_extractor.py
pytest tests/test_collocation_extractor.py
pytest tests/test_concordancer.py
pytest tests/test_concordancer_parallel.py
pytest tests/test_dependency_parser.py
pytest tests/test_keyword_extractor.py
pytest tests/test_main.py
pytest tests/test_ngram_generator.py
pytest tests/test_profiler.py
pytest tests/test_wordlist_generator.py
# Exclude tests_settings on Linux
pytest --ignore=tests/tests_nlp --ignore=tests/test_colligation_extractor.py --ignore=tests/test_collocation_extractor.py --ignore=tests/test_concordancer.py --ignore=tests/test_concordancer_parallel.py --ignore=tests/test_dependency_parser.py --ignore=tests/test_keyword_extractor.py --ignore=tests/test_main.py --ignore=tests/test_ngram_generator.py --ignore=tests/test_profiler.py --ignore=tests/test_wordlist_generator.py --ignore=tests/tests_nlp --ignore=tests/tests_settings