-
Notifications
You must be signed in to change notification settings - Fork 166
134 lines (133 loc) · 4.74 KB
/
real-time-cpp-examples.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
##############################################################################
# Copyright Christopher Kormanyos 2023.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
name: real-time-cpp-examples
on:
push:
branches:
- '**'
pull_request:
schedule:
- cron: '46 23 * * *' # run at 11:46 PM UTC
jobs:
target-avr-example_led:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
example: [ chapter02_02, chapter02_06 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install gcc-avr avr-libc
- name: target-avr-example_led
run: |
cd ${{ matrix.example }}
./build.sh /usr/bin avr
ls -la ./bin/led.elf ./bin/led.map ./bin/led.hex
working-directory: ./examples/
target-avr-examples:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
example: [ chapter02_03, chapter02_03a, chapter03_02, chapter04_04, chapter04_04a, chapter06_01, chapter06_14, chapter09_07, chapter09_08, chapter09_08a, chapter10_08, chapter10_08a, chapter11_07, chapter12_04, chapter16_08, chapter17_03, chapter17_03a ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install gcc-avr avr-libc
- name: target-avr-examples
run: |
cd ${{ matrix.example }}
./build.sh /usr/bin avr
ls -la ./bin/${{ matrix.example }}.elf ./bin/${{ matrix.example }}.map ./bin/${{ matrix.example }}.hex
working-directory: ./examples/
target-bcm2835_raspi_b-example10_09:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
example: [ chapter10_09 ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install gcc-arm-none-eabi
- name: target-bcm2835_raspi_b-example10_09
run: |
cd ${{ matrix.example }}
./build.sh /usr/bin arm-none-eabi
ls -la ./bin/${{ matrix.example }}.elf ./bin/${{ matrix.example }}.map ./bin/${{ matrix.example }}.hex ./bin/kernel.img
working-directory: ./examples/
target-msvc-examples:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
example: [ chapter02_03, chapter02_03a, chapter03_02, chapter04_04, chapter04_04a, chapter06_01, chapter06_14, chapter09_07, chapter09_08, chapter09_08a, chapter10_08, chapter10_08a, chapter10_09, chapter11_07, chapter12_04, chapter17_03, chapter17_03a ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.2
- name: target-msvc-examples
run: |
cd ${{ matrix.example }}
MSBuild -m ${{ matrix.example }}.sln -p:Configuration=Release -p:Platform=x64 /t:Rebuild
dir ./Release/${{ matrix.example }}.exe
working-directory: ./examples/
target-msvc-example16_08:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
example: [ chapter16_08 ]
steps:
- uses: actions/checkout@v3
- name: clone-boost-develop
working-directory: ${{ runner.workspace }}
run: |
git clone -b develop --depth 1 https://github.com/boostorg/boost.git ${{ runner.workspace }}/boost-root
- name: clone-boost-submods
working-directory: ${{ runner.workspace }}/boost-root
run: |
git submodule update --init tools
git submodule update --init libs/config
git submodule update --init libs/math
git submodule update --init libs/multiprecision
- name: bootstrap-boost
working-directory: ${{ runner.workspace }}/boost-root
run: |
./bootstrap.bat
./b2 headers
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.2
- name: target-msvc-example16_08
shell: cmd
working-directory: ./
run: |
cd examples/${{ matrix.example }}
set INCLUDE=${{ runner.workspace }}\real-time-cpp\examples\${{ matrix.example }}\src\mcal\win32;%INCLUDE%
set INCLUDE=${{ runner.workspace }}\real-time-cpp\examples\${{ matrix.example }}\src;%INCLUDE%
set INCLUDE=${{ runner.workspace }}\boost-root;%INCLUDE%
MSBuild -m ${{ matrix.example }}.sln -p:useenv=true -p:Configuration=Release -p:Platform=x64 /t:Rebuild
dir .\Release\${{ matrix.example }}.exe