Skip to content

Commit

Permalink
update CI for Vivado 2022.2
Browse files Browse the repository at this point in the history
Also refactor using a matrix to build for pluto and plutoplus.

Signed-off-by: Daniel Estévez <[email protected]>
  • Loading branch information
daniestevez committed Nov 19, 2023
1 parent 66ac5dc commit ba20538
Showing 1 changed file with 18 additions and 57 deletions.
75 changes: 18 additions & 57 deletions .github/workflows/build-firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ on:
# TODO: refactor this as a workflow_call action

jobs:
build-plutosdr:
name: Build Pluto SDR firmware
build-firmware:
strategy:
matrix:
target: [pluto, plutoplus]
name: Build firmware
runs-on: [self-hosted, vivado]
container:
image: ghcr.io/maia-sdr/maia-sdr-devel:latest
volumes:
- vivado2021_2:/opt/Xilinx
- vivado2022_2:/opt/Xilinx
options: --user root
steps:
- uses: actions/checkout@v3
Expand All @@ -30,72 +33,30 @@ jobs:
# 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.
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
make
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: maia-sdr-pluto-firmware
path: |
build/plutosdr-fw-*.zip
build/plutosdr-jtag-bootstrap-*.zip
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/[email protected]
if: ${{ always() }}
build-plutoplus:
name: Build Pluto+ 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.
# ADI_IGNORE_VERSION_CHECK is required because we use Vivado 2022.2.2
# instead of 2022.2.
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/Xilinx/Vitis/2022.2/.settings64-Vitis.sh
. /opt/Xilinx/Vivado/2022.2/.settings64-Vivado.sh
. /opt/Xilinx/Vitis_HLS/2022.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 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin/:/usr/bin:/sbin:/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
TARGET=plutoplus make
export ADI_IGNORE_VERSION_CHECK=1
export TARGET=${{matrix.target}}
make
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: maia-sdr-plutoplus-firmware
name: maia-sdr-${{matrix.target}}-firmware
path: |
build/plutoplus-fw-*.zip
build/plutoplus-jtag-bootstrap-*.zip
build/*-fw-*.zip
build/*-jtag-bootstrap-*.zip
build/system_top.xsa
if-no-files-found: error
# The working directory in the self-hosted runner needs be cleaned before
Expand Down

0 comments on commit ba20538

Please sign in to comment.