-
Notifications
You must be signed in to change notification settings - Fork 11
95 lines (81 loc) · 2.6 KB
/
windows.yml
File metadata and controls
95 lines (81 loc) · 2.6 KB
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
name: Windows CI
on:
push:
branches:
- master
- dev
- pr
tags:
- v*
jobs:
windows:
runs-on: windows-latest
strategy:
matrix:
python-version-major: [3]
python-version-minor: [8, 9, 10, 11, 12]
env:
BUILD_TYPE: Release
python-version: ${{ format('{0}.{1}', matrix.python-version-major, matrix.python-version-minor) }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python version
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
- name: Install Poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry config virtualenvs.path ~/.local/share/virtualenvs
- name: Cache Poetry
uses: actions/cache@v3
id: poetry-cache
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}
- name: Install Google Test
run: |
git clone https://github.com/google/googletest.git --depth 1
cd googletest
mkdir build
cd build
cmake .. `
-G "Visual Studio 17 2022" -A x64 `
-Dgtest_force_shared_crt=ON `
-DCMAKE_INSTALL_PREFIX="C:/Program Files/GoogleTest/"
cmake --build . --config "$env:BUILD_TYPE"
cmake --build . --config "$env:BUILD_TYPE" --target INSTALL
- name: CMake build
run: |
cmake -E make_directory ${{ runner.workspace }}/build
cd ${{ runner.workspace }}/build
cmake "$env:GITHUB_WORKSPACE" `
-G "Visual Studio 17 2022" -A x64 `
-DGoogleTest_DIR="C:/Program Files/GoogleTest" `
-DBUILD_TESTS=ON `
-DBUILD_EXAMPLES=ON
cmake --build . --config "$env:BUILD_TYPE"
- name: Unit test
working-directory: ${{ runner.workspace }}/build
shell: bash
run: ctest -C $BUILD_TYPE
- name: Install Python modules
if: steps.pipenv-cache.outputs.cache-hit != 'true'
run: |
poetry build -f wheel
poetry install
- name: Python module test
run: |
poetry run pytest -s tests
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: ./dist/*.whl
draft: false
prerelease: false