Skip to content

Commit

Permalink
ci: test on push and pr
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobLinCool committed Feb 13, 2024
1 parent 97a51a9 commit 53cf4c7
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
- run: go test -v
- run: go build .

stress-test:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo
ports:
- 27017:27017
env:
MONGO_INITDB_ROOT_USERNAME: user
MONGO_INITDB_ROOT_PASSWORD: password
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
- run: go build .
- run: ./ad-service & disown
env:
GIN_MODE: release
MONGODB_URI: mongodb://user:password@mongo:27017
- name: Run k6 test
uses: grafana/k6-action@v0.3.1
with:
filename: scripts/stress.js
flags: --vus 100 --duration 10s

0 comments on commit 53cf4c7

Please sign in to comment.