Skip to content

Load active incidents gracefully #10

Load active incidents gracefully

Load active incidents gracefully #10

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, image: "postgres:9.6"}
- {name: PostgreSQL 10, image: "postgres:10"}
- {name: PostgreSQL 11, image: "postgres:11"}
- {name: PostgreSQL 12, image: "postgres:12"}
- {name: PostgreSQL 13, image: "postgres:13"}
- {name: PostgreSQL latest, image: "postgres:latest"}
services:
postgres:
image: ${{ matrix.database.image }}
env:
POSTGRES_PASSWORD: notifications
ICINGA_NOTIFICATIONS_PGSQL_DB: notifications
ICINGA_NOTIFICATIONS_PGSQL_SCHEMA: ${{ github.workspace }}/schema/pgsql/schema.sql
# Wait until postgres becomes ready
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432/tcp
volumes:
- ${{ github.workspace }}/tests/sql/02-init-sql-test.sqh:/docker-entrypoint-initdb.d/02-init-sql-test.sh
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: stable
- name: Checkout code
uses: actions/checkout@v4
with:
path: current-workspace
- name: Download dependencies
run: go get -v -t -d ./...
working-directory: current-workspace
- 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: current-workspace/tests/