refactor(usage-reporter): split into classes #165
Workflow file for this run
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
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 |