Skip to content

Commit

Permalink
Merge pull request #13 from brenoma/ci/stress-testing
Browse files Browse the repository at this point in the history
CI with stress testing
  • Loading branch information
brenoma authored Nov 10, 2021
2 parents b435e25 + 8883a4b commit e6335fd
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/stress-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Stress Testing with K6

on:
pull_request:
branches:
- master

jobs:
run-server:
name: Start server and stress it with K6
runs-on: ubuntu-latest
services:
postgres: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: root
POSTGRES_DB: dongo
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: 14-alpine
- name: Install K6
run: |
curl https://github.com/loadimpact/k6/releases/download/v0.28.0/k6-v0.28.0-linux64.tar.gz -L | tar xvz --strip-components 1
- uses: bahmutov/npm-install@v1
- name: Setup Project Files
run: |
npm run build
npm run typeorm migration:run
env:
DATABASE_URL: postgres://postgres:root@localhost:${{ job.services.postgres.ports[5432] }}/dongo
- name: Run Project
run: npm start &
env:
PORT: 3000
DATABASE_URL: postgres://postgres:root@localhost:${{ job.services.postgres.ports[5432] }}/dongo
ALLOWED_ORIGINS: '*'
- name: Run k6 local test
run: ./k6 run stress-test/main.js

0 comments on commit e6335fd

Please sign in to comment.