-
Notifications
You must be signed in to change notification settings - Fork 43
147 lines (132 loc) · 8.45 KB
/
HeliOS_CI_Workflow.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
name: HeliOS CI Workflow
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:
jobs:
build-test-doc:
runs-on: ubuntu-22.04
steps:
- name: Checkout HeliOS...
uses: actions/checkout@v3
- name: Build HeliOS unit tests...
shell: bash
run: gcc -fdiagnostics-color=always -O0 -ggdb -ansi -pedantic -Wall -Wextra -Wno-unused-parameter -I${{github.workspace}}/src -I${{github.workspace}}/test/src -I${{github.workspace}}/test/src/harness -I${{github.workspace}}/test/src/unit -DPOSIX_ARCH_OTHER -DCONFIG_MEMORY_REGION_SIZE_IN_BLOCKS=0x1C20u -DCONFIG_ENABLE_SYSTEM_ASSERT -o${{github.workspace}}/test/bin/test ${{github.workspace}}/src/*.c ${{github.workspace}}/test/src/*.c ${{github.workspace}}/test/src/harness/*.c ${{github.workspace}}/test/src/unit/*.c
- name: Run HeliOS unit tests...
shell: bash
run: ${{github.workspace}}/test/bin/test
- name: Install Cppcheck...
shell: bash
run: |
sudo apt update
sudo apt -y install cppcheck
- name: Run Cppcheck...
shell: bash
run: |
cppcheck --quiet --language=c --platform=unix64 --max-ctu-depth=8 --cppcheck-build-dir=${{github.workspace}}/build --template="::{severity} file={file},line={line},col={column}::{message}" --enable=all --std=c89 -DPOSIX_ARCH_OTHER ${{github.workspace}}/src/
- name: Install Doxygen and LaTeX...
shell: bash
run: |
sudo apt update
sudo apt -y install doxygen-latex
- name: Create Doxygen config...
shell: bash
run: |
mkdir ${{github.workspace}}/temp
doxygen -g ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^$/d' ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^#.*/d' ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^ .*/d' ${{github.workspace}}/temp/HeliOS.conf
sed -i 's/ \+/ /g' ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^PROJECT_NAME .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'PROJECT_NAME = HeliOS' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^PROJECT_NUMBER .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'PROJECT_NUMBER = Kernel 0.4.1' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^PROJECT_LOGO .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'PROJECT_LOGO = ${{github.workspace}}/temp/HeliOS_OG_Logo_Light.png' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^OUTPUT_DIRECTORY .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'OUTPUT_DIRECTORY = ${{github.workspace}}/temp' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^OPTIMIZE_OUTPUT_FOR_C .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'OPTIMIZE_OUTPUT_FOR_C = YES' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^GENERATE_HTML .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'GENERATE_HTML = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^GENERATE_LATEX .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'GENERATE_LATEX = YES' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^COMPACT_LATEX .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'COMPACT_LATEX = YES' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^GENERATE_RTF .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'GENERATE_RTF = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^GENERATE_MAN .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'GENERATE_MAN = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^GENERATE_XML .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'GENERATE_XML = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^REPEAT_BRIEF .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'REPEAT_BRIEF = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^FULL_PATH_NAMES .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'FULL_PATH_NAMES = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^INPUT .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'INPUT = ${{github.workspace}}/src/config.h ${{github.workspace}}/src/HeliOS.h' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^FILE_PATTERNS .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'FILE_PATTERNS = *.h' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^RECURSIVE .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'RECURSIVE = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^CLASS_DIAGRAMS .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'CLASS_DIAGRAMS = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^HAVE_DOT .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'HAVE_DOT = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^PROJECT_BRIEF .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'PROJECT_BRIEF = ' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^SHOW_HEADERFILE .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'SHOW_HEADERFILE = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^SHOW_INCLUDE_FILES .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'SHOW_INCLUDE_FILES = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^QUIET .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'QUIET = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^WARNINGS .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'WARNINGS = YES' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^WARN_LOGFILE .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'WARN_LOGFILE = ' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^INLINE_SOURCES .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'INLINE_SOURCES = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^VERBATIM_HEADERS .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'VERBATIM_HEADERS = NO' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^ENABLE_PREPROCESSING .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'ENABLE_PREPROCESSING = YES' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^DEFINED .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'DEFINED = DOXYGEN_SHOULD_SKIP_THIS' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^ABBREVIATE_BRIEF .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'ABBREVIATE_BRIEF = ' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^MACRO_EXPANSION .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'MACRO_EXPANSION = YES' >> ${{github.workspace}}/temp/HeliOS.conf
sed -i '/^PREDEFINED .*/d' ${{github.workspace}}/temp/HeliOS.conf
echo 'PREDEFINED = \"DOXYGEN=1\"' >> ${{github.workspace}}/temp/HeliOS.conf
sort -o ${{github.workspace}}/temp/HeliOS.conf ${{github.workspace}}/temp/HeliOS.conf
cat ${{github.workspace}}/temp/HeliOS.conf
- name: Resize HeliOS logo...
shell: bash
run: |
convert -resize 1600 ${{github.workspace}}/extras/HeliOS_OG_Logo_Light.png ${{github.workspace}}/temp/HeliOS_OG_Logo_Light.png
- name: Generate LaTeX...
shell: bash
run: |
doxygen ${{github.workspace}}/temp/HeliOS.conf
sed -i 's~^\\begin{center}\%~\\begin{center}\%\n\\includegraphics{HeliOS_OG_Logo_Light.png}\\\\\n\\vspace*{1cm}~' ${{github.workspace}}/temp/latex/refman.tex
sed -i 's~Generated by Doxygen [0123456789]*.[0123456789]*.[0123456789]*~HeliOS Developer\x27s Guide~' ${{github.workspace}}/temp/latex/refman.tex
sed -i 's~Generated by Doxygen~(C)Copyright 2020-2023 HeliOS Project~' ${{github.workspace}}/temp/latex/refman.tex
- name: Generate PDF from LaTeX...
shell: bash
run: |
cd ${{github.workspace}}/temp/latex
make
cd ${{github.workspace}}
- name: Push PDF to repository...
shell: bash
run: |
cp ${{github.workspace}}/temp/latex/refman.pdf ${{github.workspace}}/doc/HeliOS_Developers_Guide.pdf
git config --global user.name 'Manny Peterson'
git config --global user.email '[email protected]'
git add ${{github.workspace}}/doc/HeliOS_Developers_Guide.pdf
git commit -m "HeliOS CI Workflow"
git push