-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from brenoma/ci/stress-testing
CI with stress testing
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |