diff --git a/.github/workflows/performance-tests.yml b/.github/workflows/performance-tests.yml index cdc21abb4..96294ec83 100644 --- a/.github/workflows/performance-tests.yml +++ b/.github/workflows/performance-tests.yml @@ -1,17 +1,17 @@ -name: Performance tests +name: GraphQL performance tests on: workflow_dispatch jobs: - compile: - name: Compile site assets + run_tests: + name: Run tests runs-on: ubuntu-latest steps: - - name: Check out the repo + - name: Check out uses: actions/checkout@v2 - - name: Run the build process with Docker + - name: Run k6 and upload results to Prometheus uses: addnab/docker-run-action@v3 with: image: grafana/k6:latest options: -v ${{ github.workspace }}:/root -e K6_PROMETHEUS_RW_USERNAME=${{ secrets.K6_PROMETHEUS_RW_USERNAME }} -e K6_PROMETHEUS_RW_PASSWORD=${{ secrets.K6_PROMETHEUS_RW_PASSWORD }} -e K6_PROMETHEUS_RW_SERVER_URL=${{ secrets.K6_PROMETHEUS_RW_SERVER_URL }} - run: k6 run -o experimental-prometheus-rw --tag testid=DataCubeMetadata --env ENV=test --env CUBE_IRI=https://culture.ld.admin.ch/sfa/StateAccounts_Office/4/ --env CUBE_LABEL=StateAccounts_Office/4/ - + queries.flatMap((q) => cubes.map((c) => getRunCommand(e, q, c))) + ) + .join(" && "); const generate = () => { - const file = `name: Performance tests + const file = `name: GraphQL performance tests on: workflow_dispatch jobs: - compile: - name: Compile site assets + run_tests: + name: Run tests runs-on: ubuntu-latest steps: - - name: Check out the repo + - name: Check out uses: actions/checkout@v2 - - name: Run the build process with Docker + - name: Run k6 and upload results to Prometheus uses: addnab/docker-run-action@v3 with: image: grafana/k6:latest options: -v \${{ github.workspace }}:/root -e K6_PROMETHEUS_RW_USERNAME=\${{ secrets.K6_PROMETHEUS_RW_USERNAME }} -e K6_PROMETHEUS_RW_PASSWORD=\${{ secrets.K6_PROMETHEUS_RW_PASSWORD }} -e K6_PROMETHEUS_RW_SERVER_URL=\${{ secrets.K6_PROMETHEUS_RW_SERVER_URL }} - run: ${envs - .map((env) => { - return queries.map((query) => { - return cubes.map((cube) => { - return `k6 run -o experimental-prometheus-rw --tag testid=${query} --env ENV=${env} --env CUBE_IRI=${cube.iri} --env CUBE_LABEL=${cube.label} -