From bf00cc95ec26b2ee2bf5d692e1dd90612fdb03c0 Mon Sep 17 00:00:00 2001 From: Fuxing Loh <4266087+fuxingloh@users.noreply.github.com> Date: Sat, 14 Aug 2021 22:02:37 +0800 Subject: [PATCH] separate e2e in `ci.yml` into `ci-e2e.yml` with 6 parallel container (#589) * added 5 parallel container for cypress * Added if forked condition as cypress cannot run on forked PR * separate out e2e into its own workflow file --- .github/dependabot.yml | 1 + .github/workflows/ci-e2e.yml | 48 ++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 36 --------------------------- 3 files changed, 49 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/ci-e2e.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f2ba44e202..83f0f68901 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,6 +4,7 @@ updates: directory: '/' schedule: interval: 'weekly' + day: 'thursday' labels: - "kind/dependencies" ignore: diff --git a/.github/workflows/ci-e2e.yml b/.github/workflows/ci-e2e.yml new file mode 100644 index 0000000000..ffca23f56c --- /dev/null +++ b/.github/workflows/ci-e2e.yml @@ -0,0 +1,48 @@ +name: CI - E2E + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + main: + name: Cypress + runs-on: ubuntu-latest + if: github.event.pull_request.head.repo.full_name == github.repository + strategy: + fail-fast: false # https://github.com/cypress-io/github-action/issues/48 + matrix: + containers: [ 1, 2, 3, 4, 5, 6 ] + steps: + - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + - uses: actions/setup-node@25316bbc1f10ac9d8798711f44914b1cf3c4e954 + with: + node-version: 15 + cache: 'npm' + + - run: npm ci + + - name: Setup Playground + run: docker-compose -f docker-compose.yml up -d + + - run: .github/workflows/ci/wait-for http://localhost:3001/_actuator/probes/liveness -t 120 + - run: .github/workflows/ci/wait-for http://localhost:3002/_actuator/probes/liveness -t 120 + - run: .github/workflows/ci/wait-for http://localhost:19551/ping -t 120 + + - uses: cypress-io/github-action@6122aa43014e18ec9c2d06fc0bdc5b6759064508 + with: + install: false + record: true + parallel: true + start: npm run start:web + wait-on: 'http://localhost:19006' + browser: chrome + spec: cypress/integration/** + env: + CYPRESS_E2E: true + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: codecov/codecov-action@51d810878be5422784e86451c0e7c14e5860ec47 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c702dd1bb9..8859e2c226 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,39 +36,3 @@ jobs: - uses: codecov/codecov-action@51d810878be5422784e86451c0e7c14e5860ec47 with: fail_ci_if_error: true - - e2e: - name: End-to-end - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - - uses: actions/setup-node@25316bbc1f10ac9d8798711f44914b1cf3c4e954 - with: - node-version: 15 - cache: 'npm' - - - run: npm ci - - - name: Setup Playground - run: docker-compose -f docker-compose.yml up -d - - - run: .github/workflows/ci/wait-for http://localhost:3001/_actuator/probes/liveness -t 120 - - run: .github/workflows/ci/wait-for http://localhost:3002/_actuator/probes/liveness -t 120 - - run: .github/workflows/ci/wait-for http://localhost:19551/ping -t 120 - - - uses: cypress-io/github-action@6122aa43014e18ec9c2d06fc0bdc5b6759064508 - with: - install: false - record: true - start: npm run start:web - wait-on: 'http://localhost:19006' - browser: chrome - spec: cypress/integration/** - env: - CYPRESS_E2E: true - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: codecov/codecov-action@51d810878be5422784e86451c0e7c14e5860ec47 - with: - fail_ci_if_error: true