Skip to content

Commit

Permalink
fix: add load-testing in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jgfranco17 committed Jun 6, 2024
1 parent 66cbfd6 commit 9fd63c2
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/load-testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Load Testing

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
run-load-testing:
runs-on: ubuntu-latest
services:
docker:
image: docker:19.03.12
options: --privileged
volumes:
- /var/run/docker.sock:/var/run/docker.sock
strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install go
uses: actions/setup-go@v5
with:
go-version-file: './api/go.mod'

- name: Install Just
uses: extractions/setup-just@v2

- name: Set up prerequisites
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Start services with Docker Compose
run: just docker-up

- name: Wait for services to be ready
run: |
echo "Waiting for services to start..."
sleep 30
- name: Install Apache Benchmark
run: sudo apt-get install -y apache2-utils

- name: Run Load Test
run: |
ab -n 1000 -c 10 http://localhost/
- name: Shutdown Docker Compose
run: just docker-down

0 comments on commit 9fd63c2

Please sign in to comment.