From 520901864877b7be3115e4fa0ee6544c3de2476c Mon Sep 17 00:00:00 2001 From: Emiliano Ciavatta Date: Wed, 28 Jul 2021 10:17:39 +0200 Subject: Add github test workflow --- .github/docker/Dockerfile | 18 ++++++++++++++++++ .github/docker/docker-compose.yml | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/docker/Dockerfile create mode 100644 .github/docker/docker-compose.yml (limited to '.github/docker') diff --git a/.github/docker/Dockerfile b/.github/docker/Dockerfile new file mode 100644 index 0000000..1f9f72d --- /dev/null +++ b/.github/docker/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:20.04 + +# Install tools and libraries +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -qq golang-1.14 pkg-config libpcap-dev libhyperscan-dev yarnpkg + +COPY ./ /caronte + +WORKDIR /caronte + +RUN ln -sf ../lib/go-1.14/bin/go /usr/bin/go && \ + go mod download && \ + go build && \ + cd frontend && \ + yarnpkg install && \ + yarnpkg build + +CMD go test -v -race -covermode=atomic diff --git a/.github/docker/docker-compose.yml b/.github/docker/docker-compose.yml new file mode 100644 index 0000000..393bb41 --- /dev/null +++ b/.github/docker/docker-compose.yml @@ -0,0 +1,16 @@ +version: "3.7" +services: + + mongo: + image: mongo:4.4 + + test: + build: + context: ../../ + dockerfile: .github/docker/Dockerfile + image: caronte-test + depends_on: + - mongo + environment: + MONGO_HOST: mongo + MONGO_PORT: 27017 -- cgit v1.2.3-70-g09d2