Haskell CI #1481
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |