Skip to content

Commit

Permalink
Dockerfile for integration testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikDeSmedt committed Apr 10, 2024
1 parent 32b341b commit 0ab5ff1
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker
tests
.github
13 changes: 13 additions & 0 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: integration-tests
run-name: python - Integration Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: docker-build
run: docker build -f docker/Dockerfile -t lsp-testing .
- name: docker-test
run: docker run lsp-testing python -m pytest
63 changes: 63 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Use a base image with necessary dependencies for compiling
FROM ubuntu:latest as cln-downloader

RUN apt-get update && apt-get install -y curl
RUN curl -Lo lightning.tar.xz https://github.com/ElementsProject/lightning/releases/download/v24.02.2/clightning-v24.02.2-Ubuntu-20.04.tar.xz

FROM ubuntu:latest as bitcoin-downloader
RUN apt-get update && apt-get install -y curl
RUN curl -Lo bitcoin.tar.gz https://bitcoin.org/bin/bitcoin-core-25.0/bitcoin-25.0-x86_64-linux-gnu.tar.gz

FROM ubuntu:latest as rust-downloader
RUN apt-get update && apt-get install -y curl
RUN curl -Lo rustup.sh https://sh.rustup.rs

FROM rust:latest as plugin-compiler
ADD . /workspace
WORKDIR workspace

RUN cargo build --workspace

FROM ubuntu:latest as python-downloader

RUN apt-get update && apt-get install -y python3 python3-venv python-pip

ENV VENV_PATH=/opt/python/venv
RUN python3 -m venv $VENV_PATH
ENV PATH=$VENV_PATH/bin:$PATH
ADD requirements.txt requirements.txt
RUN pip install -r requirements.txt

FROM ubuntu:latest as runner
RUN apt-get update && apt-get install -y libsodium-dev sqlite3 libpq5 libsqlite3-dev xz-utils python3 curl build-essential python3-pip pkg-config libssl-dev

copy --from=rust-downloader rustup.sh /tmp/rustup.sh
ENV CARGO_HOME=/opt/cargo
ENV PATH=$CARGO_HOME/bin:$PATH
RUN sh /tmp/rustup.sh -y

RUN cargo install sqlx-cli

COPY --from=cln-downloader lightning.tar.xz /tmp/lightning.tar.xz
COPY --from=bitcoin-downloader bitcoin.tar.gz /tmp/bitcoin.tar.gz
COPY --from=python-downloader /opt/python/venv /opt/python/venv

ENV PATH=/opt/python/venv/bin:$PATH
RUN tar -xf /tmp/bitcoin.tar.gz && mv /bitcoin-25.0/bin/* /usr/bin/
RUN tar -xf /tmp/lightning.tar.xz

ADD . /workspace
WORKDIR /workspace

RUN make all











0 comments on commit 0ab5ff1

Please sign in to comment.