-
Notifications
You must be signed in to change notification settings - Fork 9
104 lines (88 loc) · 2.5 KB
/
build-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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:
# 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-2019]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
# see https://github.com/microsoft/setup-msbuild
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
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
- 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