Chore: Load Tests run in CI #5
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: Load Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
determine-service-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
services: ${{ steps.determine-matrix.outputs.changes }} | |
steps: | |
- name: Check Out Repo | |
uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: determine-matrix | |
with: | |
# Note, 'common' is for future use--when code is factored out into common libraries, | |
# but it's set up here so that the workflow logic could be tested with it present | |
filters: | | |
common: | |
- '*' | |
- '.github/**' | |
account: | |
- '*' | |
- '.github/**' | |
- 'services/account/**' | |
graph: | |
- '*' | |
- '.github/**' | |
- 'services/graph/**' | |
content-publishing: | |
- '*' | |
- '.github/**' | |
- 'services/content-publishing/**' | |
content-watcher: | |
- '*' | |
- '.github/**' | |
- 'services/content-watcher/**' | |
build: | |
name: '[${{ matrix.service }}] Load Test' | |
runs-on: ubuntu-latest | |
needs: determine-service-matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
service: ${{ fromJson(needs.determine-service-matrix.outputs.services) }} | |
exclude: | |
- service: common | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
registry-url: 'https://registry.npmjs.org' | |
cache-dependency-path: tools/ci-k6/package-lock.json | |
- name: Install dependencies | |
working-directory: tools/ci-k6 | |
run: npm ci | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Start Frequency | |
run: | | |
docker compose -f docker-compose.yaml -f tools/ci-k6/docker-compose-k6.${{ matrix.service }}.yaml up -d frequency | |
sleep 20 | |
- name: Generate Provider and Capacity | |
working-directory: tools/ci-k6 | |
run: npm run main | |
# Just start the services we need... | |
- name: Start All Services | |
run: docker compose -f docker-compose.yaml -f tools/ci-k6/docker-compose-k6.${{ matrix.service }}.yaml up -d | |
- name: Setup K6 | |
uses: grafana/setup-k6-action@v1 | |
- name: Run k6 Tests | |
uses: grafana/run-k6-action@v1 | |
with: | |
only-verify-scripts: false | |
path: | | |
services/${{ matrix.service }}/k6-test/*.js | |
- name: Stop Docker Compose | |
if: always() | |
run: docker compose -f docker-compose.yaml -f tools/ci-k6/docker-compose-k6.${{ matrix.service }}.yaml down |