Do not rely on regex for topic list #240
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
paths: | |
- '**.go' | |
- 'Gopkg.lock' | |
- 'Gopkg.toml' | |
- 'Dockerfile.ci-test' | |
- '.dockerignore' | |
- '.github/workflows/*-tests.yaml' | |
- config | |
- db | |
jobs: | |
test: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
container: | |
image: tfgco/pusher:ci-test | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:7.4.0 | |
env: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
kafka: | |
image: confluentinc/cp-kafka:7.4.0 | |
options: --health-cmd "kafka-topics --list --bootstrap-server kafka:9092" --health-interval 10s --health-timeout 10s --health-retries 15 | |
env: | |
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://kafka:29092 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | |
KAFKA_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://0.0.0.0:29092 | |
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | |
KAFKA_DEFAULT_REPLICATION_FACTOR: 1 | |
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" | |
KAFKA_NUM_PARTITIONS: 5 | |
KAFKA_CREATE_TOPICS: "com.games.test:5:1" | |
postgres: | |
image: postgres:9.5 | |
env: | |
POSTGRES_HOST_AUTH_METHOD: "trust" | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
statsd: | |
image: hopsoft/graphite-statsd | |
redis: | |
image: redis:6.0.9-alpine | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up go vendor cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-build-${{ hashFiles('Gopkg.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ hashFiles('Gopkg.lock') }} | |
${{ runner.os }}-build- | |
- name: Copy checked source code to the proper container's working directory | |
run: | | |
rm -rf /go/src/github.com/topfreegames/pusher | |
cp -r . /go/src/github.com/topfreegames/pusher | |
- name: Install dependencies | |
run: | | |
cd /go/src/github.com/topfreegames/pusher | |
go mod tidy | |
go mod vendor | |
- name: Initialize DB for testing | |
run: | | |
cd /go/src/github.com/topfreegames/pusher | |
psql -U postgres -h postgres -p 5432 -f db/create-test.sql | |
- name: Test | |
run: | | |
cd /go/src/github.com/topfreegames/pusher | |
export CONFIG_FILE=${PWD}/config/docker_test.yaml | |
export GOPATH=${PWD}/vendor:${GOPATH} | |
ginkgo -v -r -tags=integration --randomizeAllSpecs --randomizeSuites --focus="\[Integration\].*" . | |
- name: Relocate vendor directory for caching | |
run: | | |
rm -rf vendor | |
cp -r /go/src/github.com/topfreegames/pusher/vendor . |