Skip to content

Commit

Permalink
ci: adds integration testing in docker
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Jun 21, 2023
1 parent 89b28f1 commit 054fbd6
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
on: [push, pull_request]
on:
push:
branches: [master]
pull_request:
branches: [master]

name: Sanity Check codebase

Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/integration_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Integration testing

on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: '30 1 1,15 * *'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Integration testing
run: |
cd docker
docker-compose up --exit-code-from coffee
119 changes: 119 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,17 @@ members = [
"coffee_httpd",
"coffee_plugin",
"coffee_testing",
"tests"
]

default-members = [
"coffee_lib",
"coffee_github",
"coffee_storage",
"coffee_core",
"coffee_cmd",
"coffee_httpd",
"coffee_plugin",
"coffee_testing",
]
resolver = "2"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CC=cargo
FMT=fmt

ARGS="--all"
ARGS=""

default: fmt
$(CC) build
Expand Down Expand Up @@ -32,4 +32,4 @@ install:
$(CC) install --locked --path ./coffee_cmd

integration:
cd tests; $(CC) test $(ARGS)
$(CC) test -p tests $(ARGS)
43 changes: 43 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM ubuntu:20.04
LABEL mantainer="Vincenzo Palazzo [email protected]"

ENV TZ=Europe/Minsk
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Ubuntu utils
RUN apt-get update && apt-get install -y \
software-properties-common \
build-essential \
curl wget

RUN apt-get update

## Install Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc

# Install bitcoin core and lightningd (last version)
RUN add-apt-repository ppa:luke-jr/bitcoincore
RUN apt-get update && apt-get install -y \
bitcoind jq libsodium-dev libpq-dev
autoconf automake build-essential git libtool libgmp-dev libsqlite3-dev \
python3 python3-pip net-tools zlib1g-dev libsodium-dev gettext \
pkg-config libssl-dev cmake

ENV CLIGHTNING_VERSION=master

RUN git clone https://github.com/ElementsProject/lightning.git --branch=$CLIGHTNING_VERSION && \
cd lightning && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
./configure --enable-developer --disable-rust && git submodule update --init --recursive && \
pip3 install --upgrade pip && \
pip3 install mako mistune==0.8.4 mrkd && \
make -j$(nproc) && make install

RUN echo $(lightningd --version)

WORKDIR workdir
COPY . .

CMD ["./docker/entrypoint.sh"]
7 changes: 7 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3.8"

services:
coffee:
build:
context: ../
dockerfile: ./docker/Dockerfile
2 changes: 2 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
RUST_BACKTRACE=1 make integration ARGS="-- --show-output"

0 comments on commit 054fbd6

Please sign in to comment.