Skip to content

Misc Updates

Misc Updates #6282

Workflow file for this run

name: Build and run all tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
if: ${{ !(contains(github.head_ref, 'ui/')) || !(contains(github.head_ref, 'cms/')) }}
strategy:
matrix:
go-version: [1.20.x]
os: [ubuntu-latest, macos-latest]
postgres-version: ["15"]
redis-version: ["6.2.6"]
typesense-version: ["0.24.0"]
runs-on: ubuntu-latest
services:
postgres:
image: postgres:${{ matrix.postgres-version }}
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_DB: convoy
POSTGRES_PASSWORD: postgres
POSTGRES_MAX_CONNECTIONS: 2000
# set up health check for postgres
options: --health-cmd pg_isready --health-interval 10ms --health-timeout 500ms --health-retries 15
steps:
- name: Start Redis v${{ matrix.redis-version }}
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: ${{ matrix.redis-version }}
redis-port: 6379
- name: Start Typesense v${{ matrix.typesense-version }}
uses: jirevwe/typesense-github-action@v1.0.1
with:
typesense-version: ${{ matrix.typesense-version }}
typesense-api-key: some-api-key
- name: Get the version
id: get_version
run: echo ::set-output name=tag::$(echo ${GITHUB_SHA:8})
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Cache go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
- name: Check out code
uses: actions/checkout@v2
- name: Get and verify dependencies
run: go mod download && go mod verify
- name: Build app to make sure there are zero issues
run: go build -o convoy ./cmd
- name: Go vet
run: go vet ./...
- name: Migrate Postgres
run: go run ./cmd migrate up
env:
CONVOY_DB_SCHEME: postgres
CONVOY_DB_HOST: localhost
CONVOY_DB_USERNAME: postgres
CONVOY_DB_PASSWORD: postgres
CONVOY_DB_DATABASE: convoy
CONVOY_DB_OPTIONS: sslmode=disable&connect_timeout=30
CONVOY_DB_PORT: 5432
CONVOY_REDIS_SCHEME: redis
CONVOY_REDIS_HOST: localhost
CONVOY_REDIS_PORT: 6379
- name: Run integration tests
run: make integration_tests
env:
TEST_DB_SCHEME: postgres
TEST_DB_HOST: localhost
TEST_DB_USERNAME: postgres
TEST_DB_PASSWORD: postgres
TEST_DB_DATABASE: convoy
TEST_DB_OPTIONS: sslmode=disable&connect_timeout=30
TEST_DB_PORT: 5432
TEST_REDIS_SCHEME: redis
TEST_REDIS_HOST: localhost
TEST_REDIS_PORT: 6379
TEST_TYPESENSE_HOST: http://localhost:8108
TEST_TYPESENSE_API_KEY: some-api-key
TEST_SEARCH_TYPE: typesense