Skip to content

Commit

Permalink
Update unittest.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bact authored Nov 1, 2024
1 parent 57cff4f commit 6452578
Showing 1 changed file with 0 additions and 86 deletions.
86 changes: 0 additions & 86 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,5 @@
name: Unit test and 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.9", "3.10", "3.11", "3.12", "3.13"]

runs-on: ${{ matrix.os }}
env:
PYICU_WIN_VER: 2.14
INSTALL_PYICU_WIN: false
INSTALL_TORCH: false
INSTALL_FULL_DEPS: false

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: |
pip install --upgrade "pip<24.1" "setuptools>=65.0.2,<=73.0.1"
pip install coverage coveralls
# pip<24.1 because https://github.com/omry/omegaconf/pull/1195
# setuptools>=65.0.2 because https://github.com/pypa/setuptools/commit/d03da04e024ad4289342077eef6de40013630a44#diff-9ea6e1e3dde6d4a7e08c7c88eceed69ca745d0d2c779f8f85219b22266efff7fR1
# setuptools<=73.0.1 because https://github.com/pypa/setuptools/issues/4620
- 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 PyICU (Windows)
if: startsWith(matrix.os, 'windows-') && env.INSTALL_PYICU_WIN == 'true'
shell: powershell
run: |
$PYTHON_WIN_VER = "${{ matrix.python-version }}"
$CP_VER = "cp" + $PYTHON_WIN_VER.Replace(".", "")
$WHEEL_URL = "https://github.com/cgohlke/pyicu-build/releases/download/v${{ env.PYICU_WIN_VER }}/PyICU-${{ env.PYICU_WIN_VER }}-${CP_VER}-${CP_VER}-win_amd64.whl"
pip install "$WHEEL_URL"
# Get wheel URL from https://github.com/cgohlke/pyicu-build/releases
- name: Install PyTorch
if: env.INSTALL_TORCH == 'true'
run: pip install torch
# If torch for the platform is not available in PyPI, use this command:
# pip install "<torch_wheel_url>"
# Get wheel URL from http://download.pytorch.org/whl/torch/
- name: Install dependencies
if: env.INSTALL_FULL_DEPS == 'true'
env:
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True
run: pip install -r docker_requirements.txt
- name: Install PyThaiNLP
run: pip install .
name: Unit test and coverage

on:
push:
paths-ignore:
Expand Down Expand Up @@ -165,14 +90,3 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: coveralls

- name: Unit test and code coverage
run: coverage run -m unittest tests
# Use 'unittest tests' instead of 'unittest discover' to avoid loading
# tests with external imports.
# Test cases loaded is defined in __init__.py in the tests directory.
- name: Coverage report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: coveralls

0 comments on commit 6452578

Please sign in to comment.