Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Haskell CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest
container:
image: ghcr.io/sim590/opendht-hs-ci
credentials:
username: sim590
password: ${{ secrets.DOCKER_CONTAINER_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: '9.4.8'
cabal-version: '3.10.3.0'

- name: Cache
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Build
run: cabal v2-build --enable-tests --enable-benchmarks all
- name: Run tests
run: cabal test all
8 changes: 8 additions & 0 deletions docker/opendht-hs-ci.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

FROM ghcr.io/sim590/opendht-hs-deps:latest
LABEL maintainer="Simon Désaulniers <sim.desaulniers@gmail.com>"
LABEL org.opencontainers.image.source="https://github.com/sim590/opendht-hs"

RUN apt update
RUN apt install sudo curl

16 changes: 16 additions & 0 deletions docker/opendht-hs-deps.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

FROM ghcr.io/savoirfairelinux/opendht/opendht-deps:latest
LABEL maintainer="Simon Désaulniers <sim.desaulniers@gmail.com>"
LABEL org.opencontainers.image.source="https://github.com/sim590/opendht-hs"

RUN git clone https://github.com/savoirfairelinux/opendht/ \
&& cd opendht \
&& git checkout v3.3.0 \
&& mkdir build && cd build \
&& cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=On \
-DOPENDHT_C=On \
-DOPENDHT_PROXY_CLIENT=On \
&& make -j8 && make install \
&& cd ../.. && rm -rf opendht