Skip to content

prepare for release v0.996.8 #321

prepare for release v0.996.8

prepare for release v0.996.8 #321

name: Python Binding on Linux
on:
pull_request:
paths:
- ".github/workflows/test-linux-python.yml"
- "mecab/**"
push:
branches:
- main
paths:
- ".github/workflows/test-linux-python.yml"
- "mecab/**"
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- "3.7"
steps:
- run: sudo apt-get install gettext
- uses: actions/checkout@v3
- name: restore cache
id: cache
uses: actions/cache@v3
with:
path: |
~/local
key: v1-mecab-${{ runner.os }}-${{ hashFiles('mecab/src/*.cpp', 'mecab/src/*.h') }}
- name: configure PATH
run: |
echo "$HOME/local/bin" >> "$GITHUB_PATH"
- name: install mecab
if: steps.cache.outputs.cache-hit != 'true'
run: |
./autogen.sh
./configure --enable-utf8-only --prefix "$HOME/local"
make -j$(nproc)
make install
sudo ldconfig
working-directory: mecab
- name: install ipadic utf-8
if: steps.cache.outputs.cache-hit != 'true'
run: |
./autogen.sh --prefix "$HOME/local"
./configure --with-charset=utf8
make
make install
working-directory: mecab-ipadic
- name: setup python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: configure C/C++
run: |
echo "LD_LIBRARY_PATH=$HOME/local/lib" >> "$GITHUB_ENV"
echo "LIBRARY_PATH=$HOME/local/lib" >> "$GITHUB_ENV"
echo "CPATH=$HOME/local/include" >> "$GITHUB_ENV"
- run: python -V
- name: build
run: |
python -m pip install .
working-directory: mecab/python
- name: test
run: |
python test.py
working-directory: mecab/python