Skip to content

Commit

Permalink
Update test scripts to resolve CI error. (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shota Aoki authored Aug 29, 2024
1 parent e09156d commit 4c2725f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 50 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/driver-cross-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ on:
- master
paths:
- '.github/workflows/driver-cross-build.yml'
- '.test/bin/**'
- '.test/lint.sh'
- '.test/**'
- 'src/drivers/**'
workflow_dispatch:
pull_request:
types: [opened, synchronize]
paths:
- '.github/workflows/driver-cross-build.yml'
- '.test/bin/**'
- '.test/lint.sh'
- '.test/**'
- 'src/drivers/**'

jobs:
Expand Down
66 changes: 20 additions & 46 deletions .test/step0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -eu

prepare_cross_compiler () {
GCC_VER="${GCC_VER:-$1}"
TAR_NAME="cross-gcc.tar.gz"
mkdir -p ${HOME}/repo/raspberrypi

echo "==========================================="
Expand All @@ -12,52 +13,25 @@ prepare_cross_compiler () {
dpkg -l | grep libgmp3-dev || sudo apt-get install libgmp3-dev
dpkg -l | grep libmpc-dev || sudo apt-get install libmpc-dev

if [ "${GCC_VER}" = "4.8" ]; then
if [ -e ${HOME}/repo/raspberrypi/tools ]; then
(cd ${HOME}/repo/raspberrypi/tools && git pull)
else
(cd ${HOME}/repo/raspberrypi && git clone --depth 1 https://github.com/raspberrypi/tools.git)
if [ ! -e ${HOME}/repo/raspberrypi/cross-pi-gcc-${GCC_VER}.0-2 ]; then
cd ${HOME}/repo/raspberrypi/
if [ ! -e ${HOME}/repo/raspberrypi/cross-gcc-${GCC_VER}.0-pi_3+.tar.gz ]; then
case "${GCC_VER}" in
"6.3")
wget -O ${TAR_NAME} "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Stretch/GCC%206.3.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204/cross-gcc-6.3.0-pi_3%2B.tar.gz"
;;
"8.3")
wget -O ${TAR_NAME} "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%208.3.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204/cross-gcc-8.3.0-pi_3%2B.tar.gz"
;;
"10.2")
wget -O ${TAR_NAME} "https://jaist.dl.sourceforge.net/project/raspberry-pi-cross-compilers/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bullseye/GCC%2010.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204/cross-gcc-10.2.0-pi_3%2B.tar.gz"
;;
"10.3")
wget -O ${TAR_NAME} "https://jaist.dl.sourceforge.net/project/raspberry-pi-cross-compilers/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bullseye/GCC%2010.3.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204/cross-gcc-10.3.0-pi_3%2B.tar.gz"
;;
esac
fi
export CROSS_COMPILE_PATH="${HOME}/repo/raspberrypi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-"
fi
if [ "${GCC_VER}" = "6.3" ]; then
if [ ! -e ${HOME}/repo/raspberrypi/cross-pi-gcc-6.3.0-2 ]; then
cd ${HOME}/repo/raspberrypi/
if [ ! -e ${HOME}/repo/raspberrypi/cross-gcc-6.3.0-pi_3+.tar.gz ]; then
wget --content-disposition "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Stretch/GCC%206.3.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204/cross-gcc-6.3.0-pi_3%2B.tar.gz"
fi
tar xvf cross-gcc-6.3.0-pi_3+.tar.gz
fi
export CROSS_COMPILE_PATH="${HOME}/repo/raspberrypi/cross-pi-gcc-6.3.0-2/bin/arm-linux-gnueabihf-"
fi
if [ "${GCC_VER}" = "8.3" ]; then
if [ ! -e ${HOME}/repo/raspberrypi/cross-pi-gcc-8.3.0-2 ]; then
cd ${HOME}/repo/raspberrypi/
if [ ! -e ${HOME}/repo/raspberrypi/cross-gcc-8.3.0-pi_3+.tar.gz ]; then
wget --content-disposition "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%208.3.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204/cross-gcc-8.3.0-pi_3%2B.tar.gz"
fi
tar xvf cross-gcc-8.3.0-pi_3+.tar.gz
fi
export CROSS_COMPILE_PATH="${HOME}/repo/raspberrypi/cross-pi-gcc-8.3.0-2/bin/arm-linux-gnueabihf-"
fi
if [ "${GCC_VER}" = "10.2" ]; then
if [ ! -e ${HOME}/repo/raspberrypi/cross-pi-gcc-10.2.0-2 ]; then
cd ${HOME}/repo/raspberrypi/
if [ ! -e ${HOME}/repo/raspberrypi/cross-gcc-10.2.0-pi_3+.tar.gz ]; then
wget --content-disposition "https://jaist.dl.sourceforge.net/project/raspberry-pi-cross-compilers/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bullseye/GCC%2010.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204/cross-gcc-10.2.0-pi_3%2B.tar.gz"
fi
tar xvf cross-gcc-10.2.0-pi_3+.tar.gz
fi
export CROSS_COMPILE_PATH="${HOME}/repo/raspberrypi/cross-pi-gcc-10.2.0-2/bin/arm-linux-gnueabihf-"
fi
if [ "${GCC_VER}" = "10.3" ]; then
if [ ! -e ${HOME}/repo/raspberrypi/cross-pi-gcc-10.3.0-2 ]; then
cd ${HOME}/repo/raspberrypi/
if [ ! -e ${HOME}/repo/raspberrypi/cross-gcc-10.3.0-pi_3+.tar.gz ]; then
wget --content-disposition "https://jaist.dl.sourceforge.net/project/raspberry-pi-cross-compilers/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bullseye/GCC%2010.3.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204/cross-gcc-10.3.0-pi_3%2B.tar.gz"
fi
tar xvf cross-gcc-10.3.0-pi_3+.tar.gz
fi
export CROSS_COMPILE_PATH="${HOME}/repo/raspberrypi/cross-pi-gcc-10.3.0-2/bin/arm-linux-gnueabihf-"
tar xvf ${TAR_NAME}
fi
export CROSS_COMPILE_PATH="${HOME}/repo/raspberrypi/cross-pi-gcc-${GCC_VER}.0-2/bin/arm-linux-gnueabihf-"
}

0 comments on commit 4c2725f

Please sign in to comment.