forked from standardsemiconductor/lion
-
Notifications
You must be signed in to change notification settings - Fork 0
225 lines (190 loc) · 6.04 KB
/
haskell.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# https://github.com/haskell/actions/tree/main/setup#model-cabal-workflow-with-caching
name: Haskell CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# run at the start of every day
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
build:
name: GHC ${{ matrix.ghc-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc-version: ['9.0']
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Free up environment resources
run: |
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Set up GHC ${{ matrix.ghc-version }}
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc-version }}
- name: Configure lion
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Configure lion-formal
working-directory: lion-formal
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Configure lion-soc
working-directory: lion-soc
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Configure lion-metric
working-directory: lion-metric
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Restore Haskell cached dependencies
uses: actions/cache/restore@v4
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- name: Install lion dependencies
run: cabal build all --only-dependencies
- name: Install lion-formal dependencies
working-directory: lion-formal
run: cabal build all --only-dependencies
- name: Install lion-soc dependencies
working-directory: lion-soc
run: cabal build all --only-dependencies
- name: Install lion-metric dependencies
working-directory: lion-metric
run: cabal build all --only-dependencies
- name: Save cached dependencies
uses: actions/cache/save@v4
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Build
run: cabal build all
# - name: Run tests
# run: cabal test all
- name: Check cabal file
run: cabal check
- name: Build documentation
run: cabal haddock all
- name: Install icestorm prerequisites
run: |
sudo apt-get update
sudo apt-get install build-essential clang bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libftdi-dev qt5-default python3-dev libboost-all-dev cmake libeigen3-dev
- name: Checkout icestorm
uses: actions/checkout@v4
with:
repository: YosysHQ/icestorm
path: icestorm
- name: Install icestorm
working-directory: icestorm
run: |
make
sudo make install
- name: Checkout nextpnr
uses: actions/checkout@v4
with:
repository: YosysHQ/nextpnr
ref: master
path: nextpnr
submodules: true
- name: Install nextpnr
working-directory: nextpnr
run: |
cmake -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local .
make
sudo make install
- name: Checkout yosys
uses: actions/checkout@v4
with:
repository: YosysHQ/yosys
ref: main
path: yosys
submodules: true
- name: Install yosys
working-directory: yosys
run: |
make -j$(nproc)
sudo make install
- name: Checkout SymbiYosys (sby)
uses: actions/checkout@v4
with:
repository: YosysHQ/sby
ref: main
path: sby
- name: Install SymbiYosys
working-directory: sby
run: |
sudo apt-get install libboost-program-options-dev autoconf libgmp-dev cmake
sudo make install
- name: Checkout Boolector
uses: actions/checkout@v4
with:
repository: boolector/boolector
ref: master
path: boolector
- name: Install boolector
working-directory: boolector
run: |
./contrib/setup-lingeling.sh
./contrib/setup-btor2tools.sh
./configure.sh
make -C build -j$(nproc)
sudo cp build/bin/{boolector,btor*} /usr/local/bin
sudo cp deps/btor2tools/build/bin/btorsim /usr/local/bin
- name: Checkout riscv-gnu-toolchain
uses: actions/checkout@v4
with:
repository: riscv/riscv-gnu-toolchain
ref: master
path: riscv-gnu-toolchain
- name: Install RISC-V toolchains
working-directory: riscv-gnu-toolchain
run: |
sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev texinfo libtool patchutils bc zlib1g-dev libexpat-dev
./configure --prefix=$HOME/opt/riscv
sudo make -j$(nproc)
echo "$HOME/opt/riscv/bin" >> $GITHUB_PATH
- name: Formal Verification
working-directory: lion-formal
run: |
cabal build
cabal run
cabal run formal -- clean
cabal clean
- name: SoC
working-directory: lion-soc
run: |
cabal build
cabal run soc
cabal run soc -- clean
cabal clean
- name: Metric
working-directory: lion-metric
run: |
cabal build
cabal run
cabal run metric -- clean
cabal clean