-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (54 loc) · 1.96 KB
/
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
name: build
on: [push]
jobs:
build:
strategy:
matrix:
platform: [{ os: windows-latest, shell: 'msys2 {0}', gen: 'MSYS Makefiles' }, { os: ubuntu-latest, shell: bash, gen: 'Ninja' }]
toolchain: [{ cross: true, cpref: 'arm-none-eabi-' }, { cross: false, cpref: '' }]
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Windows Toolchain (arm-cross)
uses: msys2/setup-msys2@v2
if: ${{ matrix.platform.os == 'windows-latest' && matrix.toolchain.cross }}
with:
path-type: inherit
msystem: mingw64
install: mingw-w64-x86_64-arm-none-eabi-toolchain
- name: Windows Toolchain (host=target)
uses: msys2/setup-msys2@v2
if: ${{ matrix.platform.os == 'windows-latest' && !matrix.toolchain.cross }}
with:
path-type: inherit
msystem: mingw64
install: mingw-w64-x86_64-toolchain
- name: Linux Toolchain (arm-cross)
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.toolchain.cross }}
run: |
sudo apt-get upgrade
sudo apt install -y gcc-arm-none-eabi
sudo apt-get install -y ninja-build
- name: Linux Toolchain (host=target)
if: ${{ matrix.platform.os == 'ubuntu-latest' && !matrix.toolchain.cross }}
run: |
sudo apt-get upgrade
sudo apt install -y gcc-13
sudo apt install -y g++-13
sudo apt-get install -y ninja-build
- uses: jwlawson/[email protected]
- name: Configure
run: |
cmake -DCMAKE_C_COMPILER="${{ matrix.toolchain.cpref }}gcc" -DCMAKE_CXX_COMPILER="${{ matrix.toolchain.cpref }}g++" -G"${{ matrix.platform.gen }}" -Bbuild .
- name: Build
run: |
cmake --build ./build --config Debug --target all
- name: Test
if: ${{ !matrix.toolchain.cross }}
run: |
ctest --test-dir ./build