-
Notifications
You must be signed in to change notification settings - Fork 593
120 lines (99 loc) · 3.09 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: ci
on: [push, pull_request]
env:
GHDL_VERSION: "v4.1.0"
VERILATOR_VERSION: "v5.030"
jobs:
build:
runs-on: ubuntu-24.04
steps:
# Checkout Repository
- name: Checkout
uses: actions/checkout@v4
- name: Setup CCache
uses: hendrikmuhs/[email protected]
with:
create-symlink: true
# Install Tools
- name: Install Tools
run: |
sudo apt-get install wget build-essential ninja-build
sudo apt-get install libevent-dev libjson-c-dev flex bison
sudo apt-get install libfl-dev libfl2 zlib1g-dev
sudo apt-get install llvm gnat help2man mold clang lld
- name: Set up SBT
uses: sbt/setup-sbt@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "setup.py"
- name: Install Python dependencies
run: |
python3 -m pip install setuptools requests pexpect meson
# Install GCC Toolchains
- name: Install GCC Toolchains
run: |
sudo python3 litex_setup.py --gcc=riscv
sudo python3 litex_setup.py --gcc=openrisc
sudo python3 litex_setup.py --gcc=powerpc
# Build / Install GHDL
- name: Cache GHDL
id: cache-ghdl
uses: actions/cache@v3
with:
path: ghdl
key: ghdl-${{ env.GHDL_VERSION }}-${{ runner.os }}
- name: Checkout GHDL
if: steps.cache-ghdl.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: ghdl/ghdl
ref: ${{ env.GHDL_VERSION }}
path: ghdl
- name: Build GHDL
if: steps.cache-ghdl.outputs.cache-hit != 'true'
run: |
cd ghdl
./configure --with-llvm-config
make -j$(nproc)
- name: Install GHDL
run: |
cd ghdl
sudo make install
# Build / Install Verilator
- name: Cache Verilator
id: cache-verilator
uses: actions/cache@v3
with:
path: verilator
key: verilator-${{ env.VERILATOR_VERSION }}-${{ runner.os }}
- name: Checkout Verilator
if: steps.cache-verilator.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: verilator/verilator
ref: ${{ env.VERILATOR_VERSION }}
path: verilator
- name: Build Verilator
if: steps.cache-verilator.outputs.cache-hit != 'true'
run: |
cd verilator
autoconf
./configure CC=clang CXX=clang++
make -j$(nproc)
- name: Install Verilator
run: |
cd verilator
sudo make install
# Install (n)Migen / LiteX / Cores
- name: Install LiteX
run: |
python3 litex_setup.py --config=full --init --install --user --dev
# Install Project
- name: Install Project
run: python3 setup.py develop --user
# Test
- name: Run Tests
run: python3 -m unittest discover -v