Update CI to Python 3.10 #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit test and code coverage (macOS) | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
# - '**.yml' | |
pull_request: | |
branches: | |
- dev | |
paths-ignore: | |
- '**.md' | |
- '**.yml' | |
- 'docs/**' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, self-hosted] | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
auto-activate-base: false | |
auto-update-conda: true | |
if: matrix.os == 'macos-latest' | |
# - name: Install mac m1 | |
# run: | | |
# mkdir -p ~/miniconda3 | |
# wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-MacOSX-arm64.sh | |
# chmod +x Miniconda3-py38_4.12.0-MacOSX-arm64.sh | |
# bash Miniconda3-py38_4.12.0-MacOSX-arm64.sh -b -u -p ~/miniconda3 | |
# ~/miniconda3/bin/conda init bash | |
# ~/miniconda3/bin/conda init zsh | |
# if: matrix.os == 'self-hosted' | |
- name: Test PyThaiNLP - M1 | |
shell: bash -l {0} | |
run: | | |
source ~/miniconda3/etc/profile.d/conda.sh | |
conda create -y -n pythainlpwork310 python=3.10 | |
conda activate pythainlpwork310 | |
conda info | |
conda list | |
python -m pip install --upgrade "pip==24.0" "setuptools<65" | |
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True pip install -r docker_requirements.txt | |
conda install -y -c conda-forge protobuf | |
pip install pytest coverage coveralls | |
conda install -y -c conda-forge icu | |
conda install -y -c conda-forge pyicu | |
pip install .[full] | |
python -m nltk.downloader omw-1.4 | |
python -m pip cache purge | |
python -m unittest discover | |
if: matrix.os == 'self-hosted' | |
- shell: bash -l {0} | |
run: | | |
conda info | |
conda list | |
if: matrix.os == 'self-hosted' | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
python -m pip install --upgrade "pip==24.0" "setuptools<65" | |
pip install pytest coverage coveralls | |
conda install -c conda-forge icu | |
conda install -c conda-forge pyicu | |
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True pip install -r docker_requirements.txt | |
pip install .[full] | |
python -m nltk.downloader omw-1.4 | |
python -m pip cache purge | |
if: matrix.os != 'self-hosted' | |
- name: Test | |
shell: bash -l {0} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_SERVICE_NAME: github | |
run: | | |
coverage run -m unittest discover | |
coveralls | |
if: matrix.os != 'self-hosted' |