Skip to content

Lazy create db.json; Introduce PYTHAINLP_READ_ONLY with scoped write protection #36

Lazy create db.json; Introduce PYTHAINLP_READ_ONLY with scoped write protection

Lazy create db.json; Introduce PYTHAINLP_READ_ONLY with scoped write protection #36

Workflow file for this run

# SPDX-FileCopyrightText: 2026 PyThaiNLP Project
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: Apache-2.0
name: Corpus test
on:
push:
branches:
- dev
paths:
- ".github/workflows/corpus.yml"
- "pythainlp/corpus/**"
- "tests/corpus/**"
pull_request:
branches:
- dev
paths:
- ".github/workflows/corpus.yml"
- "pythainlp/corpus/**"
- "tests/corpus/**"
# Avoid duplicate runs for the same source branch and repository
concurrency:
group: >-
${{ github.workflow }}-${{
github.event.pull_request.head.repo.full_name || github.repository
}}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
corpus:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: "pip"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .
- name: Test corpus catalog
env:
PYTHONIOENCODING: utf-8
run: |
python -m unittest discover -s tests/corpus -p "test_catalog*.py" -v
- name: Test built-in corpus files
env:
PYTHONIOENCODING: utf-8
run: |
python -m unittest discover -s tests/corpus -p "test_builtin_*.py" -v
- name: Test downloadable corpus files
env:
PYTHONIOENCODING: utf-8
run: |
python -m unittest discover -s tests/corpus -p "test_downloadable_*.py" -v