-
Notifications
You must be signed in to change notification settings - Fork 11
98 lines (81 loc) · 2.5 KB
/
macos.yml
File metadata and controls
98 lines (81 loc) · 2.5 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
96
97
98
name: MacOS CI
on:
push:
branches:
- master
- dev
- pr
tags:
- v*
jobs:
macos:
runs-on: macos-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
env:
C_COMPILER: ${{ matrix.compiler }}
run: |
git clone https://github.com/google/googletest.git --depth 1
cd googletest
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
cmake --build . --config $BUILD_TYPE --parallel 2
cmake --build . --target install
- name: CMake build
env:
C_COMPILER: ${{ matrix.compiler }}
run: |
cmake -E make_directory ${{runner.workspace}}/build
cd ${{runner.workspace}}/build
cmake $GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUILD_EXAMPLES=ON \
-DBUILD_TESTS=ON
cmake --build . --config $BUILD_TYPE --parallel 2
- 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