Skip to content

github-ci: add simple CI based on GitHub actions #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: testing

on:
push:
pull_request:
workflow_dispatch:

jobs:
linux:
# We want to run on external PRs, but not on our own internal
# PRs as they'll be run by the push to the branch.
#
# The main trick is described here:
# https://github.com/Dart-Code/Dart-Code/pull/2375
if: github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name != github.repository

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
tarantool:
- '1.10'
- '2.8'
- '2.9'

steps:
- name: Clone the connector
uses: actions/checkout@v2

- name: Setup tarantool ${{ matrix.tarantool }}
uses: tarantool/setup-tarantool@v1
with:
tarantool-version: ${{ matrix.tarantool }}

- name: Setup golang for the connector and tests
uses: actions/setup-go@v2
with:
go-version: 1.13

- name: Run base tests
run: |
mkdir snap xlog
TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
go clean -testcache && go test -v
kill $TNT_PID

# TODO(ylobankov): Uncomment this when tarantool/go-tarantool#115 is resolved.
# - name: Run queue tests
# working-directory: ./queue
# run: |
# mkdir snap xlog
# tarantoolctl rocks install queue 1.1.0
# TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
# go clean -testcache && go test -v
# kill $TNT_PID

- name: Run uuid tests
working-directory: ./uuid
run: |
mkdir snap xlog
TNT_PID=$(tarantool ./config.lua > tarantool.log 2>&1 & echo $!)
go clean -testcache && go test -v
kill $TNT_PID
if: ${{ matrix.tarantool != 1.10 }}

- name: Run multi tests
working-directory: ./multi
run: |
mkdir -p m1/{snap,xlog} m2/{snap,xlog}
TNT_PID_1=$(tarantool ./config_m1.lua > tarantool_m1.log 2>&1 & echo $!)
TNT_PID_2=$(tarantool ./config_m2.lua > tarantool_m2.log 2>&1 & echo $!)
go clean -testcache && go test -v
kill $TNT_PID_1 $TNT_PID_2