Skip to content

Load active incidents gracefully #5

Load active incidents gracefully

Load active incidents gracefully #5

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:
- {name: PostgreSQL 9.6, container_name: pgsql_96, image: "postgres:9.6"}
- {name: PostgreSQL 10, container_name: pgsql_10, image: "postgres:10"}
- {name: PostgreSQL 11, container_name: pgsql_11, image: "postgres:11"}
- {name: PostgreSQL 12, container_name: pgsql_12, image: "postgres:12"}
- {name: PostgreSQL 13, container_name: pgsql_13, image: "postgres:13"}
- {name: PostgreSQL latest, container_name: pgsql_latest, image: "postgres:latest"}
services:
postgres:
image: ${{ matrix.database.image }}
env:
POSTGRES_PASSWORD: notifications
POSTGRES_DB: notifications
# Wait until postgres becomes ready
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432/tcp
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: stable
- name: Checkout code
uses: actions/checkout@v4
- name: Initialise Database
run: ./init-sql-test.sh
env:
ICINGA_NOTIFICATIONS_PGSQL_SCHEMA: ${{ github.workspace }}/schema/pgsql/schema.sql
POSTGRES_USER: postgres
ICINGA_NOTIFICATIONS_PGSQL_DB: notifications
working-directory: tests/sql
- name: Download dependencies
run: go get -v -t -d ./...
- name: Run tests
env:
ICINGA_NOTIFICATIONS_PGSQL_DB: notifications
ICINGA_NOTIFICATIONS_PGSQL_USER: postgres
ICINGA_NOTIFICATIONS_PGSQL_PASSWORD: notifications
ICINGA_NOTIFICATIONS_PGSQL_HOST: 127.0.0.1
ICINGA_NOTIFICATIONS_PGSQL_PORT: 5432
timeout-minutes: 10
run: go test -v -timeout 5m ./sql
working-directory: tests/