DeFiCh/wallet

View on GitHub
.github/workflows/ci-e2e.yml

Summary

Maintainability
Test Coverage
name: CI E2E

on:
  workflow_dispatch:
  schedule:
    - cron: "0 1 * * *"
  push:
    branches: [main]
  pull_request:
    branches: [main]

concurrency:
  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  main:
    name: Cypress
    runs-on: ubuntu-20.04
    if: github.event_name != 'pull_request' || 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, 7, 8, 9, 10, 11, 12]
    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

      - name: Setup Playground
        run: docker-compose -f docker-compose.yml up -d

      - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
        with:
          node-version: 20
          cache: "npm"

      - run: npm ci

      - run: .github/workflows/ci/wait-for http://localhost:3001/_actuator/probes/liveness -t 240
      - run: .github/workflows/ci/wait-for http://localhost:3002/_actuator/probes/liveness -t 240
      - run: .github/workflows/ci/wait-for http://localhost:19550/ping -t 240

      - uses: cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a # v6.6.1
        with:
          config-file: cypress.config.js
          install: false
          record: true
          parallel: true
          start: npm run start:web
          wait-on: "http://localhost:8081"
          browser: chrome
          spec: mobile-app/cypress/e2e/**
          tag: ${{ github.event_name }}
          project: ./mobile-app
        env:
          CYPRESS_E2E: true
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}