2020-11-24 07:43:43 -05:00
|
|
|
name: ci
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2022-10-14 12:17:02 -04:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-24 07:43:43 -05:00
|
|
|
steps:
|
|
|
|
# Checkout Repository
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2021-09-15 09:27:49 -04:00
|
|
|
- name: Setup CCache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
|
|
|
2020-11-24 07:43:43 -05:00
|
|
|
# Install Tools
|
|
|
|
- name: Install Tools
|
|
|
|
run: |
|
2021-10-01 05:36:49 -04:00
|
|
|
sudo apt-get install wget build-essential python3 ninja-build
|
2021-09-15 09:27:49 -04:00
|
|
|
sudo apt-get install libevent-dev libjson-c-dev flex bison
|
|
|
|
sudo apt-get install libfl-dev libfl2 zlibc zlib1g-dev
|
2020-11-24 07:43:43 -05:00
|
|
|
pip3 install setuptools
|
2020-11-24 13:48:56 -05:00
|
|
|
pip3 install requests
|
2021-02-11 10:01:45 -05:00
|
|
|
pip3 install pexpect
|
2021-10-01 05:36:49 -04:00
|
|
|
pip3 install meson
|
2020-11-24 07:43:43 -05:00
|
|
|
|
|
|
|
# Install (n)Migen / LiteX / Cores
|
|
|
|
- name: Install LiteX
|
|
|
|
run: |
|
|
|
|
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
|
|
|
|
python3 litex_setup.py init install --user
|
|
|
|
|
2020-11-24 13:48:56 -05:00
|
|
|
# Install RISC-V GCC
|
|
|
|
- name: Install RISC-V GCC
|
|
|
|
run: |
|
|
|
|
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
|
|
|
|
python3 litex_setup.py gcc
|
2020-12-17 11:13:58 -05:00
|
|
|
sudo mkdir /usr/local/riscv
|
|
|
|
sudo cp -r $PWD/../riscv64-*/* /usr/local/riscv
|
2020-11-24 13:48:56 -05:00
|
|
|
|
2022-06-27 11:46:37 -04:00
|
|
|
# Build / Install Verilator
|
2021-09-15 09:27:49 -04:00
|
|
|
- name: Build Verilator
|
|
|
|
run: |
|
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
git clone https://github.com/verilator/verilator
|
|
|
|
cd verilator
|
|
|
|
autoconf
|
|
|
|
./configure
|
|
|
|
make -j$(nproc)
|
|
|
|
sudo make install
|
|
|
|
|
2020-11-24 07:43:43 -05:00
|
|
|
# Install Project
|
|
|
|
- name: Install Project
|
|
|
|
run: python3 setup.py develop --user
|
|
|
|
|
|
|
|
# Test
|
|
|
|
- name: Run Tests
|
2020-12-17 11:13:58 -05:00
|
|
|
run: |
|
|
|
|
export PATH=/usr/local/riscv/bin:$PATH
|
|
|
|
python3 setup.py test
|