gh-actions: use ccache and build tools before running tests
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
This commit is contained in:
parent
9f28fa4e75
commit
c4cb86efe9
82
.github/ci/build_interchange.sh
vendored
82
.github/ci/build_interchange.sh
vendored
@ -1,48 +1,52 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Install capnproto libraries
|
# Install capnproto libraries
|
||||||
curl -O https://capnproto.org/capnproto-c++-0.8.0.tar.gz
|
function build_capnp {
|
||||||
tar zxf capnproto-c++-0.8.0.tar.gz
|
curl -O https://capnproto.org/capnproto-c++-0.8.0.tar.gz
|
||||||
pushd capnproto-c++-0.8.0
|
tar zxf capnproto-c++-0.8.0.tar.gz
|
||||||
./configure
|
pushd capnproto-c++-0.8.0
|
||||||
make -j`nproc` check
|
./configure
|
||||||
sudo make install
|
make -j`nproc` check
|
||||||
popd
|
sudo make install
|
||||||
|
popd
|
||||||
|
|
||||||
|
git clone https://github.com/capnproto/capnproto-java.git
|
||||||
|
pushd capnproto-java
|
||||||
|
make -j`nproc`
|
||||||
|
sudo make install
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
# Install latest Yosys
|
# Install latest Yosys
|
||||||
git clone https://github.com/YosysHQ/yosys.git
|
function build_yosys {
|
||||||
pushd yosys
|
git clone https://github.com/YosysHQ/yosys.git
|
||||||
make -j`nproc`
|
pushd yosys
|
||||||
sudo make install
|
make -j`nproc`
|
||||||
popd
|
sudo make install
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
# Install capnproto java
|
|
||||||
git clone https://github.com/capnproto/capnproto-java.git
|
|
||||||
pushd capnproto-java
|
|
||||||
make -j`nproc`
|
|
||||||
sudo make install
|
|
||||||
popd
|
|
||||||
|
|
||||||
RAPIDWRIGHT_PATH="`pwd`/RapidWright"
|
function get_dependencies {
|
||||||
INTERCHANGE_SCHEMA_PATH="`pwd`/3rdparty/fpga-interchange-schema/interchange"
|
# Install python-fpga-interchange libraries
|
||||||
PYTHON_INTERCHANGE_PATH="`pwd`/python-fpga-interchange"
|
git clone -b ${PYTHON_INTERCHANGE_TAG} https://github.com/SymbiFlow/python-fpga-interchange.git ${PYTHON_INTERCHANGE_PATH}
|
||||||
PYTHON_INTERCHANGE_TAG="v0.0.4"
|
pushd ${PYTHON_INTERCHANGE_PATH}
|
||||||
|
git submodule update --init --recursive
|
||||||
|
python3 -m pip install -r requirements.txt
|
||||||
|
popd
|
||||||
|
|
||||||
# Install python-fpga-interchange libraries
|
## Install RapidWright
|
||||||
git clone -b $PYTHON_INTERCHANGE_TAG https://github.com/SymbiFlow/python-fpga-interchange.git $PYTHON_INTERCHANGE_PATH
|
git clone https://github.com/Xilinx/RapidWright.git ${RAPIDWRIGHT_PATH}
|
||||||
pushd $PYTHON_INTERCHANGE_PATH
|
pushd ${RAPIDWRIGHT_PATH}
|
||||||
git submodule update --init --recursive
|
make update_jars
|
||||||
python3 -m pip install -r requirements.txt
|
popd
|
||||||
popd
|
}
|
||||||
|
|
||||||
# Install RapidWright
|
function build_nextpnr {
|
||||||
git clone https://github.com/Xilinx/RapidWright.git $RAPIDWRIGHT_PATH
|
build_capnp
|
||||||
pushd $RAPIDWRIGHT_PATH
|
mkdir build
|
||||||
make update_jars
|
pushd build
|
||||||
popd
|
cmake .. -DARCH=fpga_interchange -DRAPIDWRIGHT_PATH=${RAPIDWRIGHT_PATH} -DINTERCHANGE_SCHEMA_PATH=${INTERCHANGE_SCHEMA_PATH} -DPYTHON_INTERCHANGE_PATH=${PYTHON_INTERCHANGE_PATH}
|
||||||
|
make nextpnr-fpga_interchange -j`nproc`
|
||||||
mkdir build
|
popd
|
||||||
pushd build
|
}
|
||||||
cmake .. -DARCH=fpga_interchange -DRAPIDWRIGHT_PATH=$RAPIDWRIGHT_PATH -DINTERCHANGE_SCHEMA_PATH=$INTERCHANGE_SCHEMA_PATH -DPYTHON_INTERCHANGE_PATH=$PYTHON_INTERCHANGE_PATH
|
|
||||||
make nextpnr-fpga_interchange -j`nproc`
|
|
||||||
popd
|
|
||||||
|
63
.github/workflows/interchange_ci.yml
vendored
63
.github/workflows/interchange_ci.yml
vendored
@ -3,8 +3,57 @@ name: FPGA interchange CI tests
|
|||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
Build-yosys:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev clang bison flex swig
|
||||||
|
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1
|
||||||
|
|
||||||
|
- name: Execute build yosys script
|
||||||
|
run: |
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
source ./.github/ci/build_interchange.sh
|
||||||
|
build_yosys
|
||||||
|
|
||||||
|
Build-nextpnr:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev clang bison flex swig
|
||||||
|
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1
|
||||||
|
|
||||||
|
- name: Execute build interchange script
|
||||||
|
run: |
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
source ./.github/ci/build_interchange.sh
|
||||||
|
build_nextpnr
|
||||||
|
|
||||||
Run-Tests:
|
Run-Tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: [Build-yosys, Build-nextpnr]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
device: [xc7a35t, xc7a100t, xc7a200t, xc7z010]
|
device: [xc7a35t, xc7a100t, xc7a200t, xc7z010]
|
||||||
@ -21,8 +70,20 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev clang bison flex swig
|
sudo apt-get install git make cmake libboost-all-dev python3-dev libeigen3-dev tcl-dev clang bison flex swig
|
||||||
|
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1
|
||||||
|
|
||||||
- name: Execute build interchange script
|
- name: Execute build interchange script
|
||||||
run: stdbuf -i0 -o0 -e0 ./.github/ci/build_interchange.sh
|
env:
|
||||||
|
RAPIDWRIGHT_PATH: ${{ github.workspace }}/RapidWright
|
||||||
|
INTERCHANGE_SCHEMA_PATH: ${{ github.workspace }}/3rdparty/fpga-interchange-schema/interchange
|
||||||
|
PYTHON_INTERCHANGE_PATH: ${{ github.workspace }}/python-fpga-interchange
|
||||||
|
PYTHON_INTERCHANGE_TAG: v0.0.4
|
||||||
|
|
||||||
|
run: |
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
source ./.github/ci/build_interchange.sh
|
||||||
|
build_yosys && build_nextpnr && get_dependencies
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
env:
|
env:
|
||||||
|
Loading…
Reference in New Issue
Block a user