diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9af9a86 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: Build + +# trigger the workflow on push or pull requests +on: [push, pull_request] + +jobs: + build-and-run-tests: + runs-on: ubuntu-18.04 # this is a GitHub Runner, hosting the execution + container: ubuntu:18.04 # but this is a Docker Hub container, in which everything runs + + services: + redis: + image: redis:6.2.1-alpine # Docker Hub image used as a sidecar + + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + apt-get -y update + apt-get -y --force-yes install make gcc libevent-dev libmsgpack-dev python3 + - name: Build + run: make + - name: Run Webdis and test + run: | + ./webdis .github/workflows/webdis-ci.json + sleep 2 + ./tests/basic.py + - name: Archive logs + uses: actions/upload-artifact@v2 + with: + name: webdis.log + path: webdis.log diff --git a/.github/workflows/webdis-ci.json b/.github/workflows/webdis-ci.json new file mode 100644 index 0000000..3174b7d --- /dev/null +++ b/.github/workflows/webdis-ci.json @@ -0,0 +1,27 @@ +{ + "redis_host": "redis", + "redis_port": 6379, + + "http_host": "0.0.0.0", + "http_port": 7379, + + "threads": 5, + "pool_size": 20, + + "daemonize": true, + "websockets": false, + + "database": 0, + "acl": [ + { + "disabled": [ "DEBUG" ] + }, + { + "http_basic_auth": "user:password", + "enabled": [ "DEBUG" ] + } + ], + + "verbosity": 6, + "logfile": "webdis.log" +} diff --git a/README.md b/README.md index 39d84f2..ac52133 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ [![CircleCI](https://circleci.com/gh/nicolasff/webdis.svg?style=shield)](https://circleci.com/gh/nicolasff/webdis) +[![Build](https://github.com/nicolasff/webdis/actions/workflows/build.yml/badge.svg)](https://github.com/nicolasff/webdis/actions/workflows/build.yml) + # About