-
Notifications
You must be signed in to change notification settings - Fork 35
89 lines (79 loc) · 2.27 KB
/
python.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
name: Python
on:
push:
branches:
- main
- python
pull_request:
branches:
- main
paths:
- '.github/workflows/python.yml'
- 'cmake/**'
- 'python/src/**'
- 'python/src/CMakeLists.txt'
- 'src/**'
- 'CMakeLists.txt'
- 'MANIFEST.in'
- 'pyproject.toml'
- 'setup.py'
jobs:
Build:
name: ${{ matrix.name }} Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10"]
include:
- os: ubuntu-latest
name: Linux
- os: windows-latest
name: Windows
- os: macOS-latest
name: macOS
steps:
- name: Checkout Repository
uses: actions/[email protected]
with:
fetch-depth: 10
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Install Ccache (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install ccache
echo 'CACHE_PATH=~/.cache/ccache' >> "$GITHUB_ENV"
- name: Install Ccache (macOS)
if: runner.os == 'macOS'
run: |
brew install ccache
echo 'CACHE_PATH=~/Library/Caches/ccache' >> "$GITHUB_ENV"
- name: Install Ccache (Windows)
if: runner.os == 'Windows'
run: |
choco install ccache
"CACHE_PATH=${env:LOCALAPPDATA}\ccache" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Cache Build
id: cache-build
uses: actions/[email protected]
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-Python-cache
restore-keys: ${{ runner.os }}-Release-cache
- name: Prepare Ccache
run: |
ccache --max-size=1.0G
ccache -V && ccache --show-config
ccache --show-stats && ccache --zero-stats
- name: Build and Install
run: |
pip install --verbose .
ccache --show-stats
- name: Tests
run: |
pip install -r python/tests/requirements.txt
nose2 -v --pretty-assert -s python/tests