-
Notifications
You must be signed in to change notification settings - Fork 44
168 lines (161 loc) · 5.05 KB
/
PR_build.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
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
163
164
165
166
167
168
name: PR_Build
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: pre-commit/[email protected]
gcc:
name: GCC
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- gcc: "9"
steps:
- name: Install
run: |
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty main'
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty universe'
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial main'
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial universe'
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic main'
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic universe'
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
- name: Checkout
uses: actions/checkout@v3
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-20.04
strategy:
fail-fast: false
matrix:
include:
- clang: "10"
steps:
- name: Install
run: |
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty main'
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ trusty universe'
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial main'
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ xenial universe'
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic main'
sudo add-apt-repository -yn 'deb http://archive.ubuntu.com/ubuntu/ bionic universe'
sudo apt-get update
sudo apt-get install -y clang-${{ matrix.clang }}
- name: Checkout
uses: actions/checkout@v3
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-12
strategy:
fail-fast: false
matrix:
include:
- xcode: "14.2"
steps:
- name: Checkout
uses: actions/checkout@v3
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-2019
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
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-20.04
steps:
- uses: actions/checkout@v3
- 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-20.04
steps:
- uses: actions/checkout@v3
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 make tools
run: |
python3 -m pip install --upgrade pip
pip3 install setuptools setuptools_scm cmake wheel scikit-build ninja
- name: Install python decoder
run: |
cd python
cp -r ../src .
python3 setup.py sdist
- uses: actions/upload-artifact@v4
with:
name: python-package
path: python/dist/*