mirror of
https://github.com/alerta/alerta.git
synced 2025-01-24 17:29:39 +00:00
58 lines
1.4 KiB
YAML
58 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:
|
|
db:
|
|
image: postgres:13
|
|
ports:
|
|
- 5432:5432
|
|
env:
|
|
POSTGRES_DB: monitoring
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
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@db:5432/monitoring
|
|
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()
|