From 03b8c0554f97cf914acafcf4b3fe2690d73c1ca9 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 15:25:49 +0000 Subject: [PATCH 1/2] Remove powershell --- .github/workflows/unittest-windows.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml index 1f0e94574..7eadb13d5 100644 --- a/.github/workflows/unittest-windows.yml +++ b/.github/workflows/unittest-windows.yml @@ -31,31 +31,25 @@ jobs: python-version: ${{ matrix.python-version }} cache: "pip" - name: Install build tools - shell: powershell run: | python -m pip install --upgrade "pip<24.1" "setuptools==73.0.1" python -m pip install coverage coveralls - name: Install ICU - shell: powershell 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 - shell: powershell run: python -m pip install torch # if needed, get pip wheel link from http://download.pytorch.org/whl/torch/ # - name: Install dependencies - # shell: powershell # env: # SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True # run: | # python -m pip install -r docker_requirements.txt - name: Install PyThaiNLP - shell: powershell run: | python -m pip install . - name: Test - shell: powershell env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github From c86602c5233f16404f436e1e198b9a7c2abade59 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Thu, 31 Oct 2024 15:37:34 +0000 Subject: [PATCH 2/2] Unify unittest ci workflow --- .github/workflows/unittest-windows.yml | 58 ------------------- .../{unittest-macos.yml => unittest.yml} | 14 +++-- .github/workflows/unitttest-ubuntu.yml | 54 ----------------- 3 files changed, 9 insertions(+), 117 deletions(-) delete mode 100644 .github/workflows/unittest-windows.yml rename .github/workflows/{unittest-macos.yml => unittest.yml} (76%) delete mode 100644 .github/workflows/unitttest-ubuntu.yml diff --git a/.github/workflows/unittest-windows.yml b/.github/workflows/unittest-windows.yml deleted file mode 100644 index 7eadb13d5..000000000 --- a/.github/workflows/unittest-windows.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Unit test and code coverage (Windows) - -on: - push: - paths-ignore: - - '**.md' - - 'docs/**' - pull_request: - branches: - - dev - paths-ignore: - - '**.md' - - 'docs/**' - -jobs: - unittest: - strategy: - fail-fast: false - matrix: - os: ["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 - 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: python -m 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: | - coveralls -# coverage run -m unittest discover diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest.yml similarity index 76% rename from .github/workflows/unittest-macos.yml rename to .github/workflows/unittest.yml index c2c374988..1d9efae0d 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest.yml @@ -1,4 +1,4 @@ -name: Unit test and code coverage (macOS) +name: Unit test and code coverage on: push: @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["macos-latest"] + os: ["macos-latest", "ubuntu-latest", "windows-latest"] python-version: ["3.10"] runs-on: ${{ matrix.os }} @@ -30,13 +30,12 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: "pip" - - name: Print system info - run: sw_vers; python --version; arch - 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 + - name: Install ICU (macOS) + if: startsWith(matrix.os, 'macos-') run: | brew install icu4c PKG_CONFIG_PATH=$(brew --prefix)/opt/icu4c/lib/pkgconfig @@ -44,6 +43,11 @@ jobs: 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/ diff --git a/.github/workflows/unitttest-ubuntu.yml b/.github/workflows/unitttest-ubuntu.yml deleted file mode 100644 index a9257b242..000000000 --- a/.github/workflows/unitttest-ubuntu.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Unit test and code coverage (Ubuntu) - -on: - push: - paths-ignore: - - '**.md' - - 'docs/**' - pull_request: - branches: - - dev - paths-ignore: - - '**.md' - - 'docs/**' - -jobs: - unittest: - strategy: - fail-fast: false - matrix: - os: ["ubuntu-24.04"] - 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 PyTorch - run: python -m 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: | - coveralls -# coverage run -m unittest discover