From 92a58a2631a30ac3f4c0291ecd1f2f01a912b9e9 Mon Sep 17 00:00:00 2001 From: gatecat Date: Fri, 8 Apr 2022 14:05:03 +0100 Subject: ci: Restructure and move entirely to GH actions from Cirrus Signed-off-by: gatecat --- .github/ci/build_common.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/ci/build_common.sh (limited to '.github/ci/build_common.sh') diff --git a/.github/ci/build_common.sh b/.github/ci/build_common.sh new file mode 100644 index 00000000..2a2d8447 --- /dev/null +++ b/.github/ci/build_common.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# Install latest Yosys +function build_yosys { + PREFIX=`pwd`/.yosys + YOSYS_PATH=${DEPS_PATH}/yosys + mkdir -p ${YOSYS_PATH} + git clone --recursive https://github.com/YosysHQ/yosys ${YOSYS_PATH} + pushd ${YOSYS_PATH} + git reset --hard ${YOSYS_REVISION} + make -j`nproc` PREFIX=$PREFIX + make install PREFIX=$PREFIX + popd +} + +function build_icestorm { + PREFIX=`pwd`/.icestorm + ICESTORM_PATH=${DEPS_PATH}/icestorm + mkdir -p ${ICESTORM_PATH} + git clone --recursive https://github.com/YosysHQ/icestorm ${ICESTORM_PATH} + pushd ${ICESTORM_PATH} + git reset --hard ${ICESTORM_REVISION} + make -j`nproc` PREFIX=${PREFIX} + make install PREFIX=${PREFIX} + popd +} + +function build_trellis { + PREFIX=`pwd`/.trellis + TRELLIS_PATH=${DEPS_PATH}/prjtrellis + mkdir -p ${TRELLIS_PATH} + git clone --recursive https://github.com/YosysHQ/prjtrellis ${TRELLIS_PATH} + pushd ${TRELLIS_PATH} + git reset --hard ${TRELLIS_REVISION} + mkdir -p libtrellis/build + pushd libtrellis/build + cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} .. + make -j`nproc` + make install + popd + popd +} + +function build_prjoxide { + PREFIX=`pwd`/.prjoxide + PRJOXIDE_PATH=${DEPS_PATH}/prjoxide + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ;\ + mkdir -p ${PRJOXIDE_PATH} + git clone --recursive https://github.com/gatecat/prjoxide ${PRJOXIDE_PATH} + pushd ${PRJOXIDE_PATH} + git reset --hard ${PRJOXIDE_REVISION} + cd libprjoxide + PATH=$PATH:$HOME/.cargo/bin cargo install --root $PREFIX --path prjoxide + popd +} -- cgit v1.2.3