Skip to content

Commit

Permalink
fix missing lib
Browse files Browse the repository at this point in the history
  • Loading branch information
endail committed Jan 21, 2024
1 parent d7293d6 commit 09e1e2b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 30 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build_and_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
matrix:
base_image: ["raspios_lite:latest"]
cpu: [arm1176, cortex-a8]
cpu: [arm1176, cortex-a7, cortex-a8, cortex-a53]

steps:

Expand All @@ -49,13 +49,16 @@ jobs:
ref: ${{ github.ref }}

- name: Build RPI environment
uses: pguyot/arm-runner-action@v2
uses: pguyot/arm-runner-action@v2.5.2
with:
commands: src/gh-actions-rpi-cmd.sh
base_image: ${{ matrix.base_image }}
image_additional_mb: 10000
cpu: ${{ matrix.cpu }}
optimize_image: false
shell: /bin/bash
exit_on_fail: false
debug: true
copy_artifact_path: dist/
copy_artifact_dest: .

Expand Down
9 changes: 5 additions & 4 deletions src/gh-actions-rpi-cmd.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

# update os
apt-get update -y && apt-get full-upgrade -y
# note that this is running on a virtual rpi
export VIRTUAL_PI=1;
apt-get update -y && apt-get full-upgrade -y;

# install needed packages
apt-get install git-all python3-dev python3-setuptools python3-pip python3-venv -y
apt-get install git-all python3-dev python3-setuptools python3-pip python3-venv -y;

# install liblgpio and libhx711
src/install-deps.sh
src/install-deps.sh;

# build and package
python3 -m pip install build --user
Expand Down
46 changes: 22 additions & 24 deletions src/install-deps.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
#!/bin/bash

if [ `id -u` -ne 0 ]; then
echo "Run as root"
echo "Run as root";
exit 1;
fi
# build and install liblgpio if not found
# if ! $(ldconfig -p | grep -q liblgpio); then
wget https://abyz.me.uk/lg/lg.zip
unzip lg.zip
cd lg
make
make install
ldconfig
cd ..
#else
# echo "liblgpio already installed"
#fi

# build and install libhx711 if not found
#if ! $(ldconfig -p | grep -q libhx711); then
git clone https://github.com/endail/hx711
cd hx711
make
make install
ldconfig
cd ..
#else
# echo "libhx711 already installed"
#fi
# install lgpio from apt if available
apt-get install -y liblgpio-dev;

# otherwise build and install liblgpio-dev if not found
if ! $(ldconfig -p | grep -q liblgpio); then
wget https://github.com/joan2937/lg/archive/master.zip;
unzip master.zip;
cd lg-master;
make;
make install;
ldconfig;
cd ..;
fi

# build and install libhx711
git clone https://github.com/endail/hx711;
cd hx711;
make;
make install;
ldconfig;
cd ..;

0 comments on commit 09e1e2b

Please sign in to comment.