Skip to content

Load active incidents gracefully #1

Load active incidents gracefully

Load active incidents gracefully #1

name: Tests with database
on:
push:
branches:
- main
pull_request: {}
jobs:
postgresql:
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 14, image: "postgres:14"}
- {name: PostgreSQL 15, image: "postgres:15"}
- {name: PostgreSQL latest, image: "postgres:latest"}
env:
NOTIFICATIONS_TESTS_DB_TYPE: pgsql
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
services:
postgres:
image: ${{ matrix.database.image }}
env:
POSTGRES_PASSWORD: ${{ env.NOTIFICATIONS_TESTS_DB_PASSWORD }}
POSTGRES_DB: ${{ env.NOTIFICATIONS_TESTS_DB }}
# Wait until postgres becomes ready
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- ${{ env.NOTIFICATIONS_TESTS_DB_PORT }}:${{ env.NOTIFICATIONS_TESTS_DB_PORT }}

Check failure on line 48 in .github/workflows/tests_with_database.yml

View workflow run for this annotation

GitHub Actions / Tests with database

Invalid workflow file

The workflow is not valid. .github/workflows/tests_with_database.yml (Line: 48, Col: 14): Unrecognized named-value: 'env'. Located at position 1 within expression: env.NOTIFICATIONS_TESTS_DB_PORT
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: stable
- name: Checkout code
uses: actions/checkout@v4
- name: Importing Schema
env:
PGPASSWORD: ${{ env.NOTIFICATIONS_TESTS_DB_PASSWORD }}
run: |
psql -U postgres -w -h 127.0.0.1 -d ${{ env.NOTIFICATIONS_TESTS_DB }} < ${{ github.workspace }}/schema/pgsql/schema.sql
- name: Download dependencies
run: go get -v -t -d ./...
- name: Run tests
timeout-minutes: 10
run: go test -v -timeout 5m ./...