Skip to content

Commit

Permalink
ci: add job to run e2e tests multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
BacLuc committed Nov 18, 2023
1 parent 799de3a commit 28c32db
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Tests: End to End to detect flaky tests"

on:
workflow_dispatch:
inputs:
pr_number:
type: number
description: |
Number of times the tests should run
required: true
default: 10
pull_request:
types: [opened, labeled, unlabeled, synchronize]
schedule:
- cron: '42 4 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}
cancel-in-progress: false

jobs:
create-array:
name: 'Create large array for matrix'
if: contains(github.event.pull_request.labels.*.name, 'test-flaky-e2e!') || github.event_name != 'pull_request'
runs-on: ubuntu-latest
outputs:
array: ${{ steps.array.outputs.result }}

steps:
- name: Create large array
uses: actions/github-script@v6
id: array
with:
script: |
function range(start, stop) {
return Array(stop - start)
.fill(start)
.map((value, index) => value + index);
}
return range(0, ${{ inputs.pr_number != null && inputs.pr_number || 10 }})
e2e-tests-build:
name: 'Tests: End-to-end build'
needs:
- create-array
uses: ./.github/workflows/reusable-e2e-tests-build.yml

e2e-tests-run:
name: 'Tests: End-to-end run'
needs:
- create-array
- e2e-tests-build
uses: ./.github/workflows/reusable-e2e-tests-run.yml
strategy:
fail-fast: false
matrix:
array: ${{ fromJSON(needs.create-array.outputs.array) }}

0 comments on commit 28c32db

Please sign in to comment.