Skip to content

Commit 440d3b1

Browse files
committed
Update self-hosted runner setup instructions with notes on unattended builds of unix/windows/webassembly
Signed-off-by: Jos Verlinde <[email protected]>
1 parent 07343c9 commit 440d3b1

File tree

1 file changed

+79
-2
lines changed

1 file changed

+79
-2
lines changed

selfhosted-runner.md

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ In order to allow the runner to run sudo commands without a password, add the fo
2323

2424
```bash
2525
# needed to allow deadsnakes/action to install python
26-
echo "runner ALL=(ALL:ALL) NOPASSWD:/usr/bin/add-apt-repository, /usr/bin/apt-get" | sudo tee /etc/sudoers.d/runner
26+
echo "runner ALL=(ALL:ALL) NOPASSWD:/usr/bin/add-apt-repository, /usr/bin/apt-get, /usr/bin/apt install" | sudo tee /etc/sudoers.d/runner
27+
28+
echo "jos ALL=(ALL:ALL) NOPASSWD:/usr/bin/add-apt-repository, /usr/bin/apt-get, /usr/bin/apt install" | sudo tee /etc/sudoers.d/jos
2729

2830
```
2931

@@ -37,7 +39,82 @@ pipx ensurepath
3739

3840
# pmount - mount arbitrary hotpluggable devices as normal user
3941
# needed by mptool to mount UF2 devices
40-
sodo apt install pmount
42+
sudo apt install pmount
43+
```
44+
45+
### STM32
46+
47+
The STM32 Cube Programmer CLI - X64 only
48+
needed to flash STM32 devices
49+
See : https://www.st.com/en/development-tools/stm32cubeprog.html
50+
install on linux x64
51+
```bash
52+
sudo apt install libusb-1.0.0-dev
53+
```
54+
55+
STP32 udev rules are required to allow the runner to access the STM32 devices.
56+
Files to copy to /etc/udev/rules.d/ on Ubuntu ("sudo cp *.* /etc/udev/rules.d").
57+
58+
Reload the rules with
59+
`sudo udevadm control --reload-rules && sudo udevadm trigger`
60+
61+
# Build requirements
62+
If you want to build unix / windows / webassembly targets you need to install the following packages
63+
avoid apt install to ask for confirmation
64+
I assume the same is set on GH hosted runners
65+
```bash
66+
sudo nano /etc/apt/apt.conf.d/90_assume_yes
67+
APT::Get::Assume-Yes "true"
68+
$ cat /etc/apt/apt.conf.d/90_assume_yes
69+
```
70+
ref : https://superuser.com/questions/164553/automatically-answer-yes-when-using-apt-get-install
71+
72+
73+
## Build unix using ci scripts
74+
``` bash
75+
# requirements
76+
sudo apt install -y build-essential libffi-dev pkg-config
77+
# clean
78+
make -C ports/unix clean
79+
# build unix
80+
source tools/ci.sh && ci_unix_standard_build
81+
# copy build-standard/micropython to the runner user's home directory
82+
mkdir -p ~/builds/unix
83+
cp ports/unix/build-standard/micropython ~/builds/unix/micropython
84+
```
85+
86+
# build webassembly
87+
```bash
88+
# requirements
89+
source tools/ci.sh && ci_webassembly_setup
90+
# clean
91+
make -C ports/webassembly clean
92+
# build webassembly
93+
source tools/ci.sh && ci_webassembly_build
94+
# copy
95+
mkdir -p ~/builds/webassembly
96+
cp ports/webassembly/build/*.wasm ~/builds/webassembly/
97+
cp ports/webassembly/build/*.js ~/builds/webassembly/
98+
```
99+
100+
101+
102+
## build windows
103+
Note: The Windows port's dependencies are not installed silently and need `/etc/apt/apt.conf.d/90_assume_yes`
104+
to suppress the confirmation prompt.
105+
106+
```bash
107+
# requirements
108+
source tools/ci.sh && ci_windows_setup
109+
# clean
110+
make -C ports/windows clean
111+
# build windows on linux
112+
source tools/ci.sh && ci_windows_build
113+
# copy
114+
mkdir -p ~/builds/windows
115+
cp ports/windows/build-standard/*.exe ~/builds/windows/
116+
117+
41118
```
42119

43120
### Remove conflicting packages

0 commit comments

Comments
 (0)