Skip to content

Commit c08d37b

Browse files
committed
ci: fix macOS/Windows pynini installation in CI
1 parent 4e2349f commit c08d37b

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

.github/workflows/unittest.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,31 @@ jobs:
2020
- uses: actions/checkout@v4
2121
with:
2222
fetch-depth: 0
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v4
23+
- name: Set up Conda
24+
uses: conda-incubator/setup-miniconda@v3
2525
with:
2626
python-version: ${{ matrix.python-version }}
27+
activate-environment: test
28+
- name: Install openfst (macOS)
29+
if: runner.os == 'macOS'
30+
run: |
31+
brew install openfst
32+
echo "CPLUS_INCLUDE_PATH=/opt/homebrew/include:$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
33+
echo "LIBRARY_PATH=/opt/homebrew/lib:$LIBRARY_PATH" >> $GITHUB_ENV
34+
- name: Install pynini via conda (Windows)
35+
if: runner.os == 'Windows'
36+
shell: bash -el {0}
37+
run: conda install -c conda-forge pynini
2738
- name: Install dependencies
39+
shell: bash -el {0}
2840
run: |
2941
python -m pip install --upgrade pip
30-
pip install .[test]
42+
pip install .[test] ${{ runner.os == 'Windows' && '--no-deps' || '' }}
3143
- name: Lint with flake8
44+
shell: bash -el {0}
3245
run: |
33-
# stop the build if there are Python syntax errors or undefined names
3446
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3647
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3748
- name: Test with pytest
38-
run: |
39-
pytest
49+
shell: bash -el {0}
50+
run: pytest

0 commit comments

Comments
 (0)