-
Notifications
You must be signed in to change notification settings - Fork 6
140 lines (135 loc) · 4.96 KB
/
build-documentation.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
name: Build Documentation
on: [ push, workflow_dispatch, pull_request ]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
binutils-dev \
build-essential \
clang-format \
clang-tidy \
cmake \
curl \
expat \
git \
libcmocka-dev \
libcsv-dev \
libcurl4-openssl-dev \
libesmtp-dev \
libiberty-dev \
libjson-c-dev \
liblog4c-dev \
libmnl-dev \
libsqlite3-0 \
libsqlite3-dev \
libssl-dev \
locales \
net-tools \
netcat \
ninja-build \
nodejs \
openssl \
pkg-config \
plantuml \
python-is-python3 \
python3-pip \
python3-venv \
sqlite3 \
wget \
zlib1g-dev
- name: checkout and build cmocka_extensions
run: |
git clone https://github.com/Elektrobit/cmocka_extensions.git /tmp/cmocka_extensions
cmake -B /tmp/cmocka_extensions/build /tmp/cmocka_extensions -DUNIT_TESTS=off -DCMAKE_BUILD_TYPE=Debug
make -C /tmp/cmocka_extensions/build all
sudo make -C /tmp/cmocka_extensions/build install
- name: checkout and build cmocka_mocks
run: |
git clone https://github.com/Elektrobit/cmocka_mocks.git /tmp/cmocka_mocks
cmake -B /tmp/cmocka_mocks/build /tmp/cmocka_mocks -DUNIT_TESTS=off -DCMAKE_BUILD_TYPE=Debug
make -C /tmp/cmocka_mocks/build all
sudo make -C /tmp/cmocka_mocks/build install
- name: checkout and build safu
run: |
git clone https://github.com/Elektrobit/safu.git /tmp/safu
cmake -B /tmp/safu/build /tmp/safu -DCMAKE_BUILD_TYPE=Debug
make -C /tmp/safu/build all
sudo make -C /tmp/safu/build install
- name: checkout and build samconf
run: |
git clone https://github.com/Elektrobit/samconf.git /tmp/samconf
cmake -B /tmp/samconf/build /tmp/samconf -DCMAKE_BUILD_TYPE=Debug
make -C /tmp/samconf/build all
sudo make -C /tmp/samconf/build install
- name: Build elos
env:
DESTDIR: ${{ github.workspace }}/build/Debug/dist
run: |
cmake -B ./build/Debug/cmake . -DCMAKE_BUILD_TYPE=Debug
make -C ./build/Debug/cmake all install
- name: setup python Virtual env
run: |
python -m venv ${{ github.workspace }}/.venv
. ${{ github.workspace }}/.venv/bin/activate
python -m pip install \
beautifulsoup4 \
clang==16.0.1.1 \
myst-parser \
sphinx \
sphinx-c-autodoc \
sphinx-copybutton \
sphinx-favicon \
sphinxcontrib-plantuml \
sphinxcontrib-programoutput
- name: install libcland 16 for sphinx c autodoc
# needet as long as libclang 16 isn't packaged in ubuntu-latest
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "" | sudo tee -a /etc/apt/sources.list
echo "# for llvm 16 packages" | sudo tee -a /etc/apt/sources.list
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee -a /etc/apt/sources.list
cat /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y libclang1-16
sudo ln -s /usr/lib/x86_64-linux-gnu/libclang-16.so.1 /usr/lib/libclang-16.so
- name: Build Documentation
run: ci/build_doc.sh
env:
SPHINX_VENV: "${{ github.workspace }}/.venv"
- name: pack documentation for GitHub pages
run: |
tar \
--dereference --hard-dereference \
--directory "${{ github.workspace }}/build/Debug/doc/html/" \
-cvf "$RUNNER_TEMP/artifact.tar" \
.
- name: save documentation
uses: actions/upload-artifact@v3
with:
name: github-pages
path: ${{ runner.temp }}/artifact.tar
if-no-files-found: error
publish-gh-pages:
runs-on: ubuntu-latest
if: ${{ github.ref_name == 'main' }}
needs: documentation
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2