diff options
author | gatecat <gatecat@ds0.me> | 2022-04-08 14:05:03 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2022-04-08 18:42:39 +0100 |
commit | 92a58a2631a30ac3f4c0291ecd1f2f01a912b9e9 (patch) | |
tree | af4d4919e27a49d01c1c8607c817d07644e22303 /.github/ci | |
parent | 49f178ed94b5fad00d25dbd12adea0bf4732f803 (diff) | |
download | nextpnr-92a58a2631a30ac3f4c0291ecd1f2f01a912b9e9.tar.gz nextpnr-92a58a2631a30ac3f4c0291ecd1f2f01a912b9e9.tar.bz2 nextpnr-92a58a2631a30ac3f4c0291ecd1f2f01a912b9e9.zip |
ci: Restructure and move entirely to GH actions from Cirrus
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to '.github/ci')
-rw-r--r-- | .github/ci/build_common.sh | 55 | ||||
-rw-r--r-- | .github/ci/build_ecp5.sh | 24 | ||||
-rw-r--r-- | .github/ci/build_generic.sh | 25 | ||||
-rw-r--r-- | .github/ci/build_gowin.sh | 23 | ||||
-rw-r--r-- | .github/ci/build_ice40.sh | 27 | ||||
-rw-r--r-- | .github/ci/build_machxo2.sh | 21 | ||||
-rw-r--r-- | .github/ci/build_mistral.sh | 6 | ||||
-rw-r--r-- | .github/ci/build_nexus.sh | 23 |
8 files changed, 204 insertions, 0 deletions
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 +} diff --git a/.github/ci/build_ecp5.sh b/.github/ci/build_ecp5.sh new file mode 100644 index 00000000..2d09a6f6 --- /dev/null +++ b/.github/ci/build_ecp5.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +function get_dependencies { + : +} + +function build_nextpnr { + mkdir build + pushd build + cmake .. -DARCH=ecp5 -DTRELLIS_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.trellis -DWERROR=on -DBUILD_GUI=on -DUSE_IPO=off + make nextpnr-ecp5 -j`nproc` + popd +} + +function run_tests { + export PATH=${GITHUB_WORKSPACE}/.trellis/bin:${GITHUB_WORKSPACE}/.yosys/bin:$PATH + make -j $(nproc) -C tests/ecp5/regressions NPNR=$(pwd)/build/nextpnr-ecp5 +} + +function run_archcheck { + pushd build + ./nextpnr-ecp5 --um5g-25k --package CABGA381 --test + popd +} diff --git a/.github/ci/build_generic.sh b/.github/ci/build_generic.sh new file mode 100644 index 00000000..49a73d3a --- /dev/null +++ b/.github/ci/build_generic.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +function get_dependencies { + : +} + +function build_nextpnr { + mkdir build + pushd build + cmake .. -DARCH=generic -DWERROR=on + make nextpnr-generic -j`nproc` + popd +} + +function run_tests { + export PATH=${GITHUB_WORKSPACE}/.yosys/bin:$PATH + ( export NPNR=$(pwd)/build/nextpnr-generic && cd tests/generic/flow && ./run.sh ) +} + +function run_archcheck { + pushd build + # TODO + # ./nextpnr-generic --uarch example --test + popd +} diff --git a/.github/ci/build_gowin.sh b/.github/ci/build_gowin.sh new file mode 100644 index 00000000..430cd2b0 --- /dev/null +++ b/.github/ci/build_gowin.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +function get_dependencies { + pip3 install apycula==${APYCULA_REVISION} +} + +function build_nextpnr { + mkdir build + pushd build + cmake .. -DARCH=gowin -DWERROR=on -DBUILD_GUI=on -DUSE_IPO=off + make nextpnr-gowin -j`nproc` + popd +} + +function run_tests { + : +} + +function run_archcheck { + pushd build + ./nextpnr-gowin --device GW1N-UV4LQ144C6/I5 --test + popd +} diff --git a/.github/ci/build_ice40.sh b/.github/ci/build_ice40.sh new file mode 100644 index 00000000..ea9234cc --- /dev/null +++ b/.github/ci/build_ice40.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +function get_dependencies { + : +} + +function build_nextpnr { + mkdir build + pushd build + cmake .. -DARCH=ice40 -DICESTORM_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.icestorm -DWERROR=on -DBUILD_TESTS=on -DBUILD_GUI=on + make nextpnr-ice40 nextpnr-ice40-test -j`nproc` + popd +} + +function run_tests { + export PATH=${GITHUB_WORKSPACE}/.yosys/bin:${GITHUB_WORKSPACE}/.icestorm/bin:$PATH + (cd build && ./nextpnr-ice40-test) + (export NEXTPNR=$(pwd)/build/nextpnr-ice40 && cd ice40/smoketest/attosoc && ./smoketest.sh) + make -j $(nproc) -C tests/ice40/regressions NPNR=$(pwd)/build/nextpnr-ice40 +} + +function run_archcheck { + pushd build + ./nextpnr-ice40 --hx8k --package ct256 --test + ./nextpnr-ice40 --up5k --package sg48 --test + popd +} diff --git a/.github/ci/build_machxo2.sh b/.github/ci/build_machxo2.sh new file mode 100644 index 00000000..c81a538b --- /dev/null +++ b/.github/ci/build_machxo2.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +function get_dependencies { + : +} + +function build_nextpnr { + mkdir build + pushd build + cmake .. -DARCH=machxo2 -DTRELLIS_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.trellis -DWERROR=on -DUSE_IPO=off + make nextpnr-machxo2 -j`nproc` + popd +} + +function run_tests { + : +} + +function run_archcheck { + : +} diff --git a/.github/ci/build_mistral.sh b/.github/ci/build_mistral.sh index 3c809b0e..807c6206 100644 --- a/.github/ci/build_mistral.sh +++ b/.github/ci/build_mistral.sh @@ -1,5 +1,7 @@ #!/bin/bash +export MISTRAL_PATH=${DEPS_PATH}/mistral + function get_dependencies { # Fetch mistral mkdir -p ${MISTRAL_PATH} @@ -17,6 +19,10 @@ function build_nextpnr { popd } +function run_tests { + : +} + function run_archcheck { pushd build ./nextpnr-mistral --device 5CEBA2F17A7 --test diff --git a/.github/ci/build_nexus.sh b/.github/ci/build_nexus.sh new file mode 100644 index 00000000..e8acd9b6 --- /dev/null +++ b/.github/ci/build_nexus.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +function get_dependencies { + : +} + +function build_nextpnr { + mkdir build + pushd build + cmake .. -DARCH=nexus -DOXIDE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.prjoxide + make nextpnr-nexus -j`nproc` + popd +} + +function run_tests { + : +} + +function run_archcheck { + pushd build + ./nextpnr-nexus --device LIFCL-40-9BG400CES --test + popd +} |