|
1 |
| -name: Unit test and code coverage (MacOS) |
| 1 | +name: Unit test and code coverage (macOS) |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | paths-ignore:
|
6 | 6 | - '**.md'
|
| 7 | + - '**.yml' |
7 | 8 | - 'docs/**'
|
8 |
| -# - '**.yml' |
9 | 9 | pull_request:
|
10 | 10 | branches:
|
11 | 11 | - dev
|
|
15 | 15 | - 'docs/**'
|
16 | 16 |
|
17 | 17 | jobs:
|
18 |
| - build: |
19 |
| - |
20 |
| - runs-on: ${{ matrix.os }} |
| 18 | + unittest: |
21 | 19 | strategy:
|
22 | 20 | fail-fast: false
|
23 | 21 | matrix:
|
24 |
| - os: [macos-latest, self-hosted] |
25 |
| - python-version: [3.8] |
| 22 | + os: ["macos-latest"] |
| 23 | + python-version: ["3.10"] |
| 24 | + |
| 25 | + runs-on: ${{ matrix.os }} |
26 | 26 |
|
27 | 27 | steps:
|
28 | 28 | - name: Checkout
|
29 | 29 | uses: actions/checkout@v4
|
30 | 30 | - name: Set up Python ${{ matrix.python-version }}
|
31 |
| - uses: conda-incubator/setup-miniconda@v3 |
| 31 | + uses: actions/setup-python@v5 |
32 | 32 | with:
|
33 | 33 | python-version: ${{ matrix.python-version }}
|
34 |
| - auto-activate-base: false |
35 |
| - auto-update-conda: true |
36 |
| - if: matrix.os == 'macos-latest' |
37 |
| -# - name: Install mac m1 |
38 |
| -# run: | |
39 |
| -# mkdir -p ~/miniconda3 |
40 |
| -# wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-MacOSX-arm64.sh |
41 |
| -# chmod +x Miniconda3-py38_4.12.0-MacOSX-arm64.sh |
42 |
| -# bash Miniconda3-py38_4.12.0-MacOSX-arm64.sh -b -u -p ~/miniconda3 |
43 |
| -# ~/miniconda3/bin/conda init bash |
44 |
| -# ~/miniconda3/bin/conda init zsh |
45 |
| -# if: matrix.os == 'self-hosted' |
46 |
| - - name: Test PyThaiNLP - M1 |
47 |
| - shell: bash -l {0} |
| 34 | + - name: Print system info |
| 35 | + run: sw_vers; python --version; arch |
| 36 | + - name: Install build tools |
48 | 37 | run: |
|
49 |
| - source ~/miniconda3/etc/profile.d/conda.sh |
50 |
| - conda create -y -n pythainlpwork38 python=3.8 |
51 |
| - conda activate pythainlpwork38 |
52 |
| - conda info |
53 |
| - conda list |
54 |
| - python -m pip install --upgrade pip |
55 |
| - SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True pip install -r docker_requirements.txt |
56 |
| - conda install -y -c conda-forge protobuf |
57 |
| - pip install pytest coverage coveralls typing_extensions==4.5.0 |
58 |
| - pip install ssg epitran |
59 |
| - pip install fastai==1.0.61 |
60 |
| - pip install fairseq==0.10.2 |
61 |
| - conda install -y -c conda-forge icu |
62 |
| - conda install -y -c conda-forge pyicu |
63 |
| - pip install deepcut tltk |
64 |
| - pip install .[full] |
65 |
| - python -m nltk.downloader omw-1.4 |
66 |
| - python -m pip cache purge |
67 |
| - python -m unittest discover |
68 |
| - if: matrix.os == 'self-hosted' |
69 |
| - - name: Show environment |
70 |
| - shell: bash -l {0} |
| 38 | + python -m pip install --upgrade "pip<24.1" "setuptools==73.0.1" |
| 39 | + python -m pip install coverage coveralls pytest |
| 40 | + - name: Install ICU |
71 | 41 | run: |
|
72 |
| - conda info |
73 |
| - conda list |
74 |
| - if: matrix.os == 'self-hosted' |
| 42 | + brew install icu4c |
| 43 | + PKG_CONFIG_PATH=$(brew --prefix)/opt/icu4c/lib/pkgconfig |
| 44 | + echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> "${GITHUB_ENV}" |
| 45 | + ICU_VER=$(pkg-config --modversion icu-i18n) |
| 46 | + echo "ICU_VER=${ICU_VER}" |
| 47 | + echo "ICU_VER=${ICU_VER}" >> "${GITHUB_ENV}" |
75 | 48 | - name: Install PyTorch
|
76 |
| - shell: bash -l {0} |
77 |
| - run: | |
78 |
| - pip install torch==1.10.0 |
79 |
| - if: matrix.os != 'self-hosted' |
80 |
| - - name: Install dependencies |
81 |
| - shell: bash -l {0} |
| 49 | + run: pip install torch |
| 50 | + # if needed, get pip wheel link from http://download.pytorch.org/whl/torch/ |
| 51 | + # - name: Install dependencies |
| 52 | + # env: |
| 53 | + # SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True |
| 54 | + # run: | |
| 55 | + # python -m pip install -r docker_requirements.txt |
| 56 | + - name: Install PyThaiNLP |
82 | 57 | run: |
|
83 |
| - python -m pip install --upgrade pip |
84 |
| - pip install pytest coverage coveralls |
85 |
| - conda install -c conda-forge icu |
86 |
| - conda install -c conda-forge pyicu |
87 |
| - SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True pip install -r docker_requirements.txt |
88 |
| - pip install deepcut tltk |
89 |
| - pip install .[full] |
90 |
| - python -m nltk.downloader omw-1.4 |
91 |
| - python -m pip cache purge |
92 |
| - if: matrix.os != 'self-hosted' |
| 58 | + python -m pip install . |
93 | 59 | - name: Test
|
94 |
| - shell: bash -l {0} |
95 | 60 | env:
|
96 | 61 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
97 | 62 | COVERALLS_SERVICE_NAME: github
|
98 | 63 | run: |
|
99 |
| - coverage run -m unittest discover |
| 64 | + python -m nltk.downloader omw-1.4 |
100 | 65 | coveralls
|
101 |
| - if: matrix.os != 'self-hosted' |
| 66 | +# coverage run -m unittest discover |
0 commit comments