-
Notifications
You must be signed in to change notification settings - Fork 0
183 lines (161 loc) · 5.17 KB
/
Alpine_Cmake_nsh.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
## Build Mainline NuttX every day for Alpine Action Cmake sim:nsh
name: Daily Build of NuttX for Alpine Cmake sim:nsh
permissions:
## Allow publishing of GitHub Release
contents: write
on:
## Run every day at 0:30 UTC
schedule:
- cron: '30 0 * * *'
workflow_dispatch:
push:
paths:
- '.github/workflows/Alpine_Cmake_nsh.yml'
jobs:
# Label of the container job
sim-nsh-job:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: alpine:latest
steps:
- name: Install Build Tools
run: |
apk --no-cache add \
bash \
coreutils \
findutils \
gawk \
git
- name: Install and Upgrade Base Packages
run: |
apk --no-cache --update add \
bison \
flex \
gettext \
texinfo \
gperf \
automake \
libtool \
binutils-dev \
picocom \
u-boot-tools \
util-linux \
patch \
autoconf \
build-base \
bash \
bash-completion \
shadow \
git \
curl \
rsync \
nano \
tar \
gzip \
bzip2 \
xz \
zip
- name: Install and Upgrade Packages for Nuttx
run: |
apk --no-cache --update add \
bsd-compat-headers \
zlib-dev \
ncurses-dev \
linux-headers \
libx11-dev \
libxft-dev \
libxext-dev \
libusb-dev
- name: Install Development Tools Packages
run: |
apk --no-cache --update add \
cmake \
xxd \
python3 \
py3-pip
## Alpine 3.19.x Fix pip error: externally-managed-environment
## https://github.com/alpinelinux/docker-alpine/issues/361
- name: Create the virtual environment
run: |
python3 -m venv --system-site-packages /usr/local \
&& pip3 install --root-user-action=ignore --no-cache-dir \
setuptools \
wheel \
pyelftools \
cxxfilt \
ninja \
kconfiglib
## WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager.
## It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
## ignore warning message
## Container -> ENV PIP_ROOT_USER_ACTION=ignore
## Action -> pip install --root-user-action=ignore
## WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user.
## The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
## Container -> ENV PIP_NO_CACHE_DIR=false
## Action -> pip3 install --no-cache-dir
## only for Alpine 3.18.x
## - name: Install Python 3 option
## run: |
## pip3 install --root-user-action=ignore --no-cache-dir \
## setuptools \
## wheel \
## pyelftools \
## cxxfilt \
## kconfiglib
- name: Install kconfig-frontends
run: |
cd /tmp \
&& git clone https://bitbucket.org/nuttx/tools.git \
&& cd tools \
&& cd kconfig-frontends \
&& ./configure --enable-mconf --disable-nconf --disable-gconf --disable-qconf \
&& ln -s /usr/bin/aclocal /usr/local/bin/aclocal-1.15 \
&& ln -s /usr/bin/automake /usr/local/bin/automake-1.15 \
&& make \
&& make install \
&& cd /
- name: Install genromfs
run: |
cd /tmp \
&& git clone https://github.com/chexum/genromfs.git \
&& cd genromfs \
&& make \
&& make install \
&& cd /
- name: Checkout Source Files
run: |
mkdir nuttxspace
cd nuttxspace
git clone https://github.com/apache/incubator-nuttx nuttx
git clone https://github.com/apache/incubator-nuttx-apps apps
## git clone --single-branch --branch simbit18-alpine https://github.com/simbit18/nuttx.git nuttx
## git clone --single-branch --branch simbit18-alpine https://github.com/simbit18/nuttx-apps.git apps
- name: Build
run: |
## Move to nuttx
cd nuttxspace/nuttx
ls
## Show the GCC version
gcc -v
## Configure the build
cmake -B build_sim -DBOARD_CONFIG=sim:nsh -GNinja
## Preserve the build config
cp build_sim/.config build_sim/nuttx.config
## Run the build
cmake --build build_sim
- name: Get Current Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Publish the GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: alpine-cmake-sim-nsh-${{ steps.date.outputs.date }}
draft: false
prerelease: false
generate_release_notes: false
files: |
nuttxspace/nuttx/build_sim/nuttx
nuttxspace/nuttx/build_sim/nuttx.config
nuttxspace/nuttx/build_sim/nuttx.manifest