From df83861ca16f415acacef0740b672d10f7c7e78e Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Fri, 27 Sep 2024 19:43:40 -0700 Subject: [PATCH] Add GitHub Actions workflow for unit testing Signed-off-by: Andrei Vagin --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ tests/image/ubuntu/Dockerfile | 8 ++++++++ tests/image/ubuntu/run.sh | 10 ++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 tests/image/ubuntu/Dockerfile create mode 100755 tests/image/ubuntu/run.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e2e94c0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: Unit Tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Build the Docker image + run: docker build -t librseq-ci-image tests/image/ubuntu/ + + - name: Run unit tests + run: | + docker run -v $(pwd):/librseq --rm librseq-ci-image ./tests/image/ubuntu/run.sh diff --git a/tests/image/ubuntu/Dockerfile b/tests/image/ubuntu/Dockerfile new file mode 100644 index 0000000..6b67ca4 --- /dev/null +++ b/tests/image/ubuntu/Dockerfile @@ -0,0 +1,8 @@ +FROM ubuntu:24.04 + +ENV DEBIAN_FRONTEND="noninteractive" +RUN apt-get update && \ + apt-get install -y autotools-dev autoconf build-essential \ + automake pkg-config libtool libnuma-dev + +WORKDIR /librseq diff --git a/tests/image/ubuntu/run.sh b/tests/image/ubuntu/run.sh new file mode 100755 index 0000000..2ac1fc8 --- /dev/null +++ b/tests/image/ubuntu/run.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -exo pipefail + +./bootstrap +./configure +make +make check +make install +ldconfig