alerta_alerta/.github/workflows/performance.yml

59 lines
1.4 KiB
YAML

name: Performance
on:
push:
branches: [ master, release/* ]
tags: [ '**' ]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
load-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: alerta
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
alerta:
image: ghcr.io/alerta/alerta-api
ports:
- 8080:8080
env:
DEBUG: 1
DATABASE_URL: postgres://postgres:postgres@postgres:5432/alerta
options: >-
--health-cmd "curl --fail http://localhost:8080/_ || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-start-period 30s
steps:
- name: Perf test
run: >-
docker run
--network host
ghcr.io/act10ns/hey
-z 2s
-m POST
-T application/json
-d '{"environment":"Production","service":["network"],"resource":"router01","event":"node_down"}'
http://localhost:8080/alert
- uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()