diff --git a/.github/actions/CI/Dockerfile b/.github/actions/CI/Dockerfile new file mode 100644 index 0000000..e341d00 --- /dev/null +++ b/.github/actions/CI/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:18.04 + +RUN DEBIAN_FRONTEND=noninteractive \ + TZ=Europe/Minsk \ + apt-get update && apt-get install -y curl unzip + +RUN curl -L https://tarantool.io/CpzRHm/release/2.6/installer.sh | bash + +RUN apt-get -y install tarantool + +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/CI/action.yml b/.github/actions/CI/action.yml new file mode 100644 index 0000000..0404e96 --- /dev/null +++ b/.github/actions/CI/action.yml @@ -0,0 +1,5 @@ +name: 'Tests and Lint' +description: 'Run test cases and check lint' +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/.github/actions/CI/entrypoint.sh b/.github/actions/CI/entrypoint.sh new file mode 100755 index 0000000..638643f --- /dev/null +++ b/.github/actions/CI/entrypoint.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +echo "building..." +make build + +echo "bootstrapping..." +make bootstrap + +echo "Running lint" +make lint + +echo "Running tests" +.rocks/bin/luatest -v --coverage +.rocks/bin/luacov . && grep -A999 '^Summary' luacov.report.out diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..5acbde3 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,29 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + # Runs a set of commands using the runners shell + - name: Run a Tests and Lint + uses: ./.github/actions/CI diff --git a/Makefile b/Makefile index fa27773..a431fdc 100644 --- a/Makefile +++ b/Makefile @@ -21,5 +21,5 @@ lint: .PHONY: test test: lint rm -f luacov* - .rocks/bin/luatest -v --shuffle all --coverage + .rocks/bin/luatest -v --coverage .rocks/bin/luacov . && grep -A999 '^Summary' luacov.report.out