Use windows 2019 to build wheels for 64-bit windows (#65) #109
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: build-windows | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/build-windows.yml' | |
- 'CMakeLists.txt' | |
- 'cmake/**' | |
- 'kaldifst/csrc/**' | |
- 'kaldifst/python/**' | |
- 'setup.py' | |
pull_request: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/build-windows.yml' | |
- 'CMakeLists.txt' | |
- 'cmake/**' | |
- 'kaldifst/csrc/**' | |
- 'kaldifst/python/**' | |
- 'setup.py' | |
workflow_dispatch: | |
concurrency: | |
group: build-windows-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-windows: | |
name: ${{ matrix.python-version }} | |
# see https://github.com/actions/virtual-environments/blob/win19/20210525.0/images/win/Windows2019-Readme.md | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# see https://github.com/microsoft/setup-msbuild | |
- name: Add msbuild to PATH | |
uses: microsoft/[email protected] | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install Python dependencies | |
run: | | |
pip3 install -qq wheel twine dataclasses numpy typing_extensions setuptools | |
- name: Display CMake version | |
run: | | |
cmake --version | |
cmake --help | |
- name: Configure CMake | |
shell: bash | |
run: | | |
mkdir build_release | |
cd build_release | |
cmake -DCMAKE_BUILD_TYPE=Release .. | |
ls -lh | |
- name: Build kaldifst | |
run: | | |
cd build_release | |
cmake --build . --target _kaldifst --config Release | |
cmake --build . --target ALL_BUILD --config Release | |
- name: Display generated files | |
shell: bash | |
run: | | |
cd build_release | |
ls -lh lib/*/* | |
- name: Build wheel | |
shell: bash | |
run: | | |
python3 setup.py bdist_wheel | |
ls -lh dist/ | |
pip install ./dist/*.whl | |
- name: Upload Wheel | |
uses: actions/upload-artifact@v2 | |
with: | |
name: python-${{ matrix.python-version }}-${{ matrix.os }} | |
path: dist/*.whl | |
- name: Run tests | |
shell: bash | |
run: | | |
cd build_release | |
ctest -C Release --output-on-failure |