diff --git a/.github/workflows/Automerge.yml b/.github/workflows/Automerge.yml index c835ba6d8..7acc0e3b1 100644 --- a/.github/workflows/Automerge.yml +++ b/.github/workflows/Automerge.yml @@ -17,6 +17,8 @@ jobs: Pipeline: if: ${{ !(github.event_name != 'pull_request' && github.actor == 'dependabot[bot]') }} uses: ./.github/workflows/Pipeline.yml + secrets: + LICENSE_TUNNEL_KEY_DATA: ${{ secrets.LICENSE_TUNNEL_KEY_DATA }} Automerge: diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index d2aff1eb7..e45a4c98b 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -2,6 +2,9 @@ name: Pipeline on: workflow_call: + secrets: + LICENSE_TUNNEL_KEY_DATA: + required: false jobs: @@ -17,6 +20,10 @@ jobs: family: ['artix7', 'zynq7', 'kintex7', 'spartan7'] env: + GHA_SSH_TUNNEL_KEY: "${{ secrets.LICENSE_TUNNEL_KEY_DATA }}" + GHA_SSH_TUNNEL_CONFIG: "${{ secrets.LICENSE_TUNNEL_SSH_CONFIG }}" + GHA_SSH_TUNNEL_CONFIG_SECRET_NAME: "xilinx_license_server_config" + GHA_SSH_TUNNEL_KEY_SECRET_NAME: "xilinx_license_server_key" ALLOW_ROOT: true GHA_EXTERNAL_DISK: "tools" XILINX_LOCAL_USER_DATA: "no" @@ -31,8 +38,34 @@ jobs: run: | DEBIAN_FRONTEND=noninteractive apt update -qq DEBIAN_FRONTEND=noninteractive apt install -qq -y \ - bash bison build-essential ca-certificates clang-format cmake psmisc \ - colordiff coreutils git flex python3 python3-dev python3-venv xsltproc libtinfo5 + bash \ + bison \ + build-essential \ + ca-certificates \ + clang-format \ + cmake \ + colordiff \ + coreutils \ + flex \ + git \ + iproute2 \ + iputils-ping \ + libtinfo5 \ + netcat-openbsd \ + psmisc \ + python3 \ + python3-dev \ + python3-venv \ + xsltproc \ + sudo \ + + - name: Xilinx Setup + run: | + git config --global --add safe.directory /root/prjxray/prjxray + .github/workflows/scripts/xilinx.sh + env: + USE_LICENSE_SERVER: "true" + XRAY_SETTINGS: ${{ matrix.family }} - name: Build run: make build --output-sync=target --warn-undefined-variables -j$(nproc) diff --git a/.github/workflows/scripts/db.sh b/.github/workflows/scripts/db.sh index 82ad2515e..ab9461661 100755 --- a/.github/workflows/scripts/db.sh +++ b/.github/workflows/scripts/db.sh @@ -15,7 +15,6 @@ echo echo "=======================================" echo "Creating Vivado Symbolic Link" echo "---------------------------------------" -ln -s /mnt/aux/Xilinx /opt/Xilinx ls /opt/Xilinx/Vivado source /opt/Xilinx/Vivado/2017.2/settings64.sh vivado -version diff --git a/.github/workflows/scripts/xilinx.sh b/.github/workflows/scripts/xilinx.sh new file mode 100755 index 000000000..2290d080a --- /dev/null +++ b/.github/workflows/scripts/xilinx.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# Copyright (C) 2017-2022 The Project X-Ray Authors. +# +# Use of this source code is governed by a ISC-style +# license that can be found in the LICENSE file or at +# https://opensource.org/licenses/ISC +# +# SPDX-License-Identifier: ISC + +echo +echo "========================================" +echo "Xilinx proprietary toolchain setup." +echo "----------------------------------------" + +echo +echo "Fix up the Xilinx configuration directory" +echo "----------------------------------------" +mkdir -p ~/.Xilinx +ls -l ~/.Xilinx +mkdir ~/.ssh +echo +echo "Fixing loader to be able to run lmutils" +echo "----------------------------------------" +ln -s /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 + +export XILINX_LOCAL_USER_DATA=no +echo "----------------------------------------" + +echo +echo "Select Xilinx Vivado version" +echo "----------------------------------------" +( + set -e + cd /opt + if [ x"$XRAY_SETTINGS" = x"kintex7" ]; then + echo "Using Xilinx Vivado Design Edition for $XRAY_SETTINGS build." + echo + ln -s /mnt/aux/Xilinx-design /opt/Xilinx + ls -l Xilinx + echo + else + ln -s /mnt/aux/Xilinx /opt/Xilinx + echo "Using Xilinx Vivado WebPack Edition for $XRAY_SETTINGS build." + ls -l Xilinx + fi +) +echo "----------------------------------------" + + +echo +echo "List /opt directory" +echo "----------------------------------------" +ls -l /opt +echo "----------------------------------------" + +echo $GHA_SSH_TUNNEL_CONFIG_SECRET_NAME +if [[ ! -z "$USE_LICENSE_SERVER" ]]; then + + echo + echo "Xilinx license server ssh key found, checking the license" + echo + + echo "127.0.0.1 xlic.int" | sudo tee -a /etc/hosts + + source /opt/Xilinx/Vivado/2017.2/settings64.sh + export PATH=/opt/Xilinx/Vivado/2017.2/bin/unwrapped/lnx64.o:$PATH + echo "-----" + lmutil lmstat -a -c 2100@localhost -i || true + echo "-----" + + export XILINXD_LICENSE_FILE=2100@localhost + +else + echo + echo "**No** Xilinx license server ssh key found." +fi +echo "----------------------------------------"