Skip to content

Specify a limited test suite #7

Specify a limited test suite

Specify a limited test suite #7

Workflow file for this run

name: Unit test and code coverage
on:
push:
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
branches:
- dev
paths-ignore:
- '**.md'
- 'docs/**'
jobs:
unittest:
strategy:
fail-fast: false
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
python-version: ["3.10"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install build tools
run: |
python -m pip install --upgrade "pip<24.1" "setuptools==73.0.1"
python -m pip install coverage coveralls
- name: Install ICU (macOS)
if: startsWith(matrix.os, 'macos-')
run: |
brew install icu4c
PKG_CONFIG_PATH=$(brew --prefix)/opt/icu4c/lib/pkgconfig
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> "${GITHUB_ENV}"
ICU_VER=$(pkg-config --modversion icu-i18n)
echo "ICU_VER=${ICU_VER}"
echo "ICU_VER=${ICU_VER}" >> "${GITHUB_ENV}"
- name: Install ICU (Windows)
if: startsWith(matrix.os, 'windows-')
run: |
python -m pip install "https://github.com/cgohlke/pyicu-build/releases/download/v2.14/PyICU-2.14-cp310-cp310-win_amd64.whl"
# if needed, get pip wheel link from https://github.com/cgohlke/pyicu-build/releases
- name: Install PyTorch
run: pip install torch
# if needed, get pip wheel link from http://download.pytorch.org/whl/torch/
# - name: Install dependencies
# env:
# SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True
# run: |
# python -m pip install -r docker_requirements.txt
- name: Install PyThaiNLP
run: |
python -m pip install .
- name: Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
coverage run -m unittest discover
coveralls