-
Notifications
You must be signed in to change notification settings - Fork 65
162 lines (155 loc) · 4.53 KB
/
PR_build.yml
File metadata and controls
162 lines (155 loc) · 4.53 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: PR_Build
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: pre-commit/action@v3.0.0
gcc:
name: GCC
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- gcc: "9"
steps:
- name: Install
run: |
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=Debug .
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
CXXFLAGS: ${{ matrix.cxxflags }}
- name: Build
run: cmake --build .
- name: Test
run: ctest --output-on-failure -V -C Debug .
clang:
name: Clang
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- clang: "16"
cxxflags: -fsanitize=leak -fno-sanitize-recover=all
steps:
- name: Install
run: |
sudo apt-get update
sudo apt-get install -y clang-${{ matrix.clang }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=Debug .
env:
CC: clang-${{ matrix.clang }}
CXX: clang++-${{ matrix.clang }}
CXXFLAGS: >-
${{ matrix.cxxflags }}
${{ contains(matrix.cxxflags, 'libc++') && '-I/usr/lib/llvm-10/include/c++/v1/' || '' }}
- name: Build
run: cmake --build .
- name: Test
run: ctest --output-on-failure -V -C Debug .
xcode:
name: XCode
needs: clang
runs-on: macos-14
strategy:
fail-fast: false
matrix:
include:
- xcode: "16.1"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Select XCode version
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=Debug .
- name: Build
run: cmake --build .
- name: Test
run: ctest --output-on-failure -V -C Debug .
msvc:
name: Visual Studio
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=Debug .
- name: Build
run: cmake --build .
- name: Test
run: ctest --output-on-failure -V -C Debug .
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Build examples
env:
PLATFORMIO_BUILD_CACHE_DIR: "../../.pio/buildcache"
run: |
find . -name platformio.ini -type f | sed 's,/platformio.ini$,,' | xargs --verbose -n 1 pio run --jobs 2 --project-dir
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # deep clone for setuptools-scm
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install build tools # Step name updated for clarity
run: |
python3 -m pip install --upgrade pip
pip3 install setuptools setuptools_scm cmake wheel scikit-build ninja
- name: Build TheengsDecoder wheel # Step name and command updated
run: |
cd python
cp -r ../src .
python3 setup.py bdist_wheel # Changed sdist to bdist_wheel
cd .. # Added cd back to root
- name: Install TheengsDecoder wheel # New step
run: pip3 install python/dist/*.whl # Installs the built wheel
- name: Test TheengsDecoder import # New step
run: python3 -c "from TheengsDecoder import decodeBLE; print('Successfully imported decodeBLE from PR_build.yml')" # Tests the import
- uses: actions/upload-artifact@v4 # Existing step, will now upload the .whl file(s)
with:
name: python-package
path: python/dist/*