-
Notifications
You must be signed in to change notification settings - Fork 9
109 lines (94 loc) · 3.31 KB
/
Push_firmware_to_master.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
name: push firmware to master
on:
push:
branches:
- 'master'
paths:
- 'firmware/**'
jobs:
build-debug:
name: Build [Debug] and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: fiam/arm-none-eabi-gcc@v1
with:
release: '9-2020-q2' # The arm-none-eabi-gcc release to use.
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/firmware/
- name: Configure CMake [Debug]
working-directory: ${{github.workspace}}/firmware/
shell: bash
run: cmake -B${{github.workspace}}/firmware/build -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${{github.workspace}}/firmware/cmake/arm_toolchain.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -G "Unix Makefiles"
- name: Build [Debug]
working-directory: ${{github.workspace}}/firmware/
shell: bash
run: cmake --build ${{github.workspace}}/firmware/build --config Debug --target all
- name: View build info [all]
shell: bash
working-directory: ${{github.workspace}}/firmware/build
run: |
for file in generated/*/build_info.h
do
echo "===================================="
echo "$file"
echo " "
cat "$file"
done
- name: Run Test
shell: bash
working-directory: ${{github.workspace}}/firmware/build/Test
run: |
for file in UT_*
do
./$file
if [ $? == 0 ]
then
GOODCOUNT=$(($GOODCOUNT+1))
fi
TOTCOUNT=$(($TOTCOUNT+1))
done
echo -n "Total of tests" $TOTCOUNT", completed successfully" $GOODCOUNT
build-release:
name: Build [Release] and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: fiam/arm-none-eabi-gcc@v1
with:
release: '9-2020-q2' # The arm-none-eabi-gcc release to use.
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/firmware/
- name: Configure CMake [Release]
working-directory: ${{github.workspace}}/firmware/
shell: bash
run: cmake -B${{github.workspace}}/firmware/build -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${{github.workspace}}/firmware/cmake/arm_toolchain.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -G "Unix Makefiles"
- name: Build [Release]
working-directory: ${{github.workspace}}/firmware/
shell: bash
run: cmake --build ${{github.workspace}}/firmware/build --config Release --target all
- name: View build info [all]
shell: bash
working-directory: ${{github.workspace}}/firmware/build
run: |
for file in generated/*/build_info.h
do
echo "===================================="
echo "$file"
echo " "
cat "$file"
done
- name: Run Test
shell: bash
working-directory: ${{github.workspace}}/firmware/build/Test
run: |
for file in UT_*
do
./$file
if [ $? == 0 ]
then
GOODCOUNT=$(($GOODCOUNT+1))
fi
TOTCOUNT=$(($TOTCOUNT+1))
done
echo -n "Total of tests" $TOTCOUNT", completed successfully" $GOODCOUNT