From 718cb15ecb893e5c0c3006853d58ce8ab47358e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Est=C3=A9vez?= Date: Fri, 17 Nov 2023 20:44:44 +0100 Subject: [PATCH] add Maia SDR CI to build AntSDR firmware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Estévez --- .github/workflows/build-firmware.yml | 68 ++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/build-firmware.yml diff --git a/.github/workflows/build-firmware.yml b/.github/workflows/build-firmware.yml new file mode 100644 index 0000000..91b37c2 --- /dev/null +++ b/.github/workflows/build-firmware.yml @@ -0,0 +1,68 @@ +name: 'build-firmware' +on: + push: + branches: + - maia-sdr-ci + +jobs: + build: + strategy: + matrix: + target: [ant, e200] + name: Build AntSDR firmware + runs-on: [self-hosted, vivado] + container: + image: ghcr.io/maia-sdr/maia-sdr-devel:latest + volumes: + - vivado2021_2:/opt/Xilinx + options: --user root + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Build firmware + # xsct, which is run by the make process, uses Xvfb, which usually needs a + # connection to an X server (even though it is a CLI application). We run + # Xvfb in the container to create a "fake" X session that makes xsct + # happy. + # + # We cannot '.' the main settings.sh file for Vivado, because it uses + # 'source' to run the sub-files, and we are not using bash. Instead, we + # '.' each individual sub-file. + # + # The symbolic link into the buildroot/output/host directory is needed + # because buildroot symlinks the binaries of the external toolchain, but + # these are shell scripts that have relative locations to their dirname, + # so symlinking them breaks them unless we do this hack. + run: | + . /opt/Xilinx/Vitis/2021.2/.settings64-Vitis.sh + . /opt/Xilinx/Vivado/2021.2/.settings64-Vivado.sh + . /opt/Xilinx/Vitis_HLS/2021.2/.settings64-Vitis_HLS.sh + . /opt/rust/env + export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin/:/usr/bin:/sbin:/bin:/opt/gcc-arm-linux-gnueabi/bin:$PATH:/opt/oss-cad-suite/bin + export PYTHONPATH=/usr/local/lib/python3.10/dist-packages + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y xvfb + Xvfb :10 & + export DISPLAY=:10 + export ADI_IGNORE_VERSION_CHECK=1 + export VIVADO_VERSION=2021.2 + export TARGET=${{matrix.target}} + mkdir -p plutosdr-fw/buildroot/output/host/ + ln -s /opt/gcc-arm-linux-gnueabi/x86_64-petalinux-linux \ + plutosdr-fw/buildroot/output/host/x86_64-petalinux-linux + make -C plutosdr-fw + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: maia-sdr-${{matrix.target}}-firmware + path: | + plutosdr-fw/build/antsdr-fw-*.zip + plutosdr-fw/build/antsdr-jtag-bootstrap-*.zip + plutosdr-fw/build/system_top.xsa + if-no-files-found: error + # The working directory in the self-hosted runner needs be cleaned before + # building. We use if: ${{ always() }} to clean even if the build fails. + - name: Clean up runner working dir + uses: TooMuch4U/actions-clean@v2.1 + if: ${{ always() }}