-
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.
- Loading branch information
1 parent
66cbfd6
commit 9fd63c2
Showing
1 changed file
with
55 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,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 |