tools/ci: add initial support for MSYS2

removed uname from msys2 job
This commit is contained in:
simbit18 2024-01-08 18:15:00 +01:00 committed by Xiang Xiao
parent 540e7f475f
commit eaf1d07809
3 changed files with 111 additions and 9 deletions

View File

@ -219,3 +219,71 @@ jobs:
name: macos-builds
path: buildartifacts/
continue-on-error: true
msys2:
needs: Fetch-Source
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
boards: [msys2]
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: MSYS
update: false
install: >-
base-devel
gcc
gperf
automake
autoconf
git
python3
ncurses-devel
unzip
zip
tio
zlib-devel
cmake
ninja
python-pip
vim
- name: pip3 install
run: |
pip3 install --root-user-action=ignore --no-cache-dir pyelftools cxxfilt kconfiglib
- run: git config --global core.autocrlf false
- name: Download Source Artifact
uses: actions/download-artifact@v3
with:
name: source-bundle
path: .
- name: Extract sources
run: tar zxf sources.tar.gz
- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
- name: Run Builds
run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json"
export ARTIFACTDIR=`pwd`/buildartifacts
git config --global --add safe.directory /github/workspace/sources/nuttx
git config --global --add safe.directory /github/workspace/sources/apps
cd sources/nuttx/tools/ci
./cibuild.sh -g -i -A -C -R testlist/${{matrix.boards}}.dat
- uses: actions/upload-artifact@v3
with:
name: msys2-builds
path: buildartifacts/
continue-on-error: true

View File

@ -64,21 +64,35 @@ function arm-gcc-toolchain {
add_path "${tools}"/gcc-arm-none-eabi/bin
if [ ! -f "${tools}/gcc-arm-none-eabi/bin/arm-none-eabi-gcc" ]; then
local flavor
local archivetool
local basefile
case ${os} in
Darwin)
flavor=-darwin
archivetool=tar
basefile=arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi
;;
Linux)
flavor=
archivetool=tar
basefile=arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi
;;
MSYS*)
archivetool=unzip
basefile=arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi
;;
esac
cd "${tools}"
wget --quiet https://developer.arm.com/-/media/Files/downloads/gnu/13.2.Rel1/binrel/arm-gnu-toolchain-13.2.Rel1${flavor}-x86_64-arm-none-eabi.tar.xz
xz -d arm-gnu-toolchain-13.2.Rel1${flavor}-x86_64-arm-none-eabi.tar.xz
tar xf arm-gnu-toolchain-13.2.Rel1${flavor}-x86_64-arm-none-eabi.tar
mv arm-gnu-toolchain-13.2.Rel1${flavor}-x86_64-arm-none-eabi gcc-arm-none-eabi
rm arm-gnu-toolchain-13.2.Rel1${flavor}-x86_64-arm-none-eabi.tar
if [ "$archivetool" == "tar" ]; then
wget --quiet https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/${basefile}.tar.xz
xz -d ${basefile}.tar.xz
tar xf ${basefile}.tar
mv ${basefile} gcc-arm-none-eabi
rm ${basefile}.tar
else
wget --quiet https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/${basefile}.zip
unzip -qo ${basefile}.zip
mv ${basefile} gcc-arm-none-eabi
rm ${basefile}.zip
fi
fi
command arm-none-eabi-gcc --version
@ -177,6 +191,10 @@ function c-cache {
cd ccache-3.7.7; ./configure --prefix="${tools}"/ccache; make; make install
cd "${tools}"; rm -rf ccache-3.7.7; rm ccache-3.7.7.tar.gz
;;
MSYS*)
pacman -S --noconfirm --needed ccache
pacman -Q
;;
esac
fi
@ -590,6 +608,9 @@ case ${os} in
Linux)
install="arm-clang-toolchain arm-gcc-toolchain arm64-gcc-toolchain avr-gcc-toolchain binutils bloaty clang-tidy gen-romfs gperf kconfig-frontends mips-gcc-toolchain python-tools riscv-gcc-toolchain rust rx-gcc-toolchain sparc-gcc-toolchain xtensa-esp32-gcc-toolchain u-boot-tools util-linux wasi-sdk c-cache"
;;
MSYS*)
install="arm-gcc-toolchain kconfig-frontends"
;;
esac
pushd .
@ -598,7 +619,9 @@ esac
done
popd
setup_links
if [ -d "${CCACHE_DIR}" ]; then
setup_links
fi
echo PATH="${EXTRA_PATH}"/"${PATH}" > "${tools}"/env.sh
}
@ -612,6 +635,9 @@ function run_builds {
Linux)
ncpus=$(grep -c ^processor /proc/cpuinfo)
;;
MSYS*)
ncpus=$(grep -c ^processor /proc/cpuinfo)
;;
esac
options+="-j ${ncpus}"

View File

@ -0,0 +1,8 @@
# Chose a minimalistic subset of board/configs due to MSYS2 builds
# being extremely slow on GitHub
# ARM
/arm/stm32/nucleo-l152re/configs/nsh,CONFIG_ARM_TOOLCHAIN_GNU_EABI
/arm/stm32/nucleo-f4x1re/configs/f411-nsh,CONFIG_ARM_TOOLCHAIN_GNU_EABI