-
Notifications
You must be signed in to change notification settings - Fork 7
67 lines (59 loc) · 1.82 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Benchmark
on:
pull_request:
branches:
- master
jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Use Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
cache-dependency-path: 'k6/yarn.lock'
- name: Use Ruby
uses: ruby/setup-ruby@2a9a743e19810b9f3c38060637daf594dbd7b37f
with:
working-directory: ./k6/graphql-api
ruby-version: '3.3'
bundler-cache: true
- name: Start GraphQL API with hive enabled
working-directory: ./k6/graphql-api
run: |
bundle
bundle exec puma -t 0:1 -p 9292 &
npx wait-on http://localhost:9292 --timeout 5s
env:
HIVE_ENABLED: 'true'
- name: Start GraphQL API with hive disabled
working-directory: ./k6/graphql-api
run: |
bundle
bundle exec puma -t 0:1 -p 9291 &
npx wait-on http://localhost:9291 --timeout 5s
env:
HIVE_ENABLED: 'false'
- name: Start Fake Usage API
working-directory: ./k6/
run: |
yarn
node usage-api.js &
npx wait-on http://localhost:8888 --timeout 5s
- name: Install k6
working-directory: ./k6
env:
K6_RELEASE_ARTIFACT_URL:
https://github.com/grafana/k6/releases/download/v0.37.0/k6-v0.37.0-linux-amd64.tar.gz
run: curl "${K6_RELEASE_ARTIFACT_URL}" -L | tar xvz --strip-components 1
- name: Run Benchmark
working-directory: ./k6
run: |
./k6 \
-e GITHUB_PR=${{ github.event.number }} \
-e GITHUB_SHA=${{ github.sha }} \
-e GITHUB_TOKEN=${{secrets.GH_PA_TOKEN}} \
run k6.js