Skip to content

Load active incidents gracefully #24

Load active incidents gracefully

Load active incidents gracefully #24

Workflow file for this run

name: SQL
on:
push:
branches:
- main
pull_request: {}
jobs:
sql:
name: ${{ matrix.database.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
database:
- {type: PGSQL, name: PostgreSQL 9.6, image: "postgres:9.6"}
- {type: PGSQL, name: PostgreSQL 10, image: "postgres:10"}
- {type: PGSQL, name: PostgreSQL 11, image: "postgres:11"}
- {type: PGSQL, name: PostgreSQL 12, image: "postgres:12"}
- {type: PGSQL, name: PostgreSQL 13, image: "postgres:13"}
- {type: PGSQL, name: PostgreSQL latest, image: "postgres:latest"}
services:
${{ matrix.database.type }}:
image: ${{ matrix.database.image }}
env:
POSTGRES_PASSWORD: notifications
POSTGRES_DB: notifications
options: --name ${{ matrix.database.type }}
ports:
- 5432:5432
volumes:
- ${{ github.workspace }}/schema/pgsql/schema.sql:/docker-entrypoint-initdb.d/notifications.sql
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: stable
- name: Checkout code
uses: actions/checkout@v4
with:
path: workspace # Due to the services volumes
- name: Restarting ${{ matrix.database.type }} Container
uses: docker://docker
with:
args: docker restart ${{ matrix.database.type }}
- name: Download dependencies
run: go get -v -t -d ./...
working-directory: workspace
- name: Run tests
env:
NOTIFICATIONS_TESTS_DB_TYPE: ${{ matrix.database.type }}
NOTIFICATIONS_TESTS_DB: notifications
NOTIFICATIONS_TESTS_DB_USER: postgres
NOTIFICATIONS_TESTS_DB_PASSWORD: notifications
NOTIFICATIONS_TESTS_DB_HOST: 127.0.0.1
NOTIFICATIONS_TESTS_DB_PORT: 5432
timeout-minutes: 10
run: go test -v -timeout 5m ./...
working-directory: workspace