2020-11-24 07:43:43 -05:00
|
|
|
name: ci
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2022-12-09 05:06:58 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2020-11-24 07:43:43 -05:00
|
|
|
steps:
|
|
|
|
# Checkout Repository
|
|
|
|
- name: Checkout
|
2022-12-09 05:06:58 -05:00
|
|
|
uses: actions/checkout@v3
|
2020-11-24 07:43:43 -05:00
|
|
|
|
2021-09-15 09:27:49 -04:00
|
|
|
- name: Setup CCache
|
2022-12-09 05:06:58 -05:00
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
2021-09-15 09:27:49 -04:00
|
|
|
|
2020-11-24 07:43:43 -05:00
|
|
|
# Install Tools
|
|
|
|
- name: Install Tools
|
|
|
|
run: |
|
2023-04-07 18:59:14 -04:00
|
|
|
sudo apt-get install wget build-essential ninja-build
|
2021-09-15 09:27:49 -04:00
|
|
|
sudo apt-get install libevent-dev libjson-c-dev flex bison
|
2022-12-09 05:06:58 -05:00
|
|
|
sudo apt-get install libfl-dev libfl2 zlib1g-dev
|
2023-04-07 18:59:14 -04:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.9"
|
|
|
|
cache: "pip"
|
|
|
|
cache-dependency-path: "setup.py"
|
|
|
|
|
|
|
|
- name: Install Python dependencies
|
|
|
|
run: |
|
|
|
|
python3 -m pip install setuptools requests pexpect 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: |
|
2022-12-08 15:57:50 -05:00
|
|
|
sudo python3 litex_setup.py --gcc=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: |
|
2023-01-20 13:14:17 -05:00
|
|
|
sudo apt-get install help2man
|
2021-09-15 09:27:49 -04:00
|
|
|
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: |
|
|
|
|
python3 setup.py test
|