Skip to content

Haskell CI

Haskell CI #430

Workflow file for this run

name: Haskell CI
permissions:
contents: read
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# run at the start of every day
- cron: '0 0 * * *'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
ghc: ['9.0', '9.8']
os: [ubuntu-20.04]
name: ${{ matrix.os }} GHC ${{ matrix.ghc }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup Haskell
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
- name: configure
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Restore 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 dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: cabal build all --only-dependencies
- name: save cached dependencies
uses: actions/cache/save@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: build
run: cabal build all
# TODO
# - name: check
# run: cabal check
- name: document
run: cabal haddock
- 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: test
run: cabal run test -- --no-create
- name: demo
run: |
cabal install
bx --FiatLux -s
bx --RgbCounter -s
bx --RgbCycle -s
bx --Hello -s
bx --Echo -s
bx --LedCtrl -s
bx --SpramReverse -s