-
Notifications
You must be signed in to change notification settings - Fork 10
59 lines (50 loc) · 1.59 KB
/
CI-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
name: CI
on:
push:
pull_request:
jobs:
build:
name: build-linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Install build package dependencies
run: |
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi ninja-build lcov
# Force gcc-10 to be the default
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 40
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 60
sudo update-alternatives --config g++
- name: Build STM32 dependencies
run: |
echo "Number of processors:" `nproc`
make get-deps -j `nproc`
- name: Run old STM32 Makefile build
run: |
CONTROL=SINE make
make clean
CONTROL=FOC make
- name: CMake build on host (x86_64)
run: |
cd ${{ github.workspace }}
mkdir -p build/host
cd build/host
cmake --preset default ../..
cmake --build .
- name: CMake build for STM32F1
run: |
cd ${{ github.workspace }}
mkdir -p build/stm32f1
cd build/stm32f1
cmake --preset stm32f1 ../..
cmake --build .
- name: Run unit tests on host
run: |
cd ${{ github.workspace }}
build/host/test/OpenInverterTest