name: Dashboard Cypress Tests

on:
  schedule:
    - cron: "0 6 * * *"
  workflow_dispatch:

jobs:
  cypress-run:
    runs-on: ubuntu-latest
    container:
      image: cypress/browsers:node16.14.2-slim-chrome103-ff102
      options: --user 1001
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Cypress run
        uses: cypress-io/github-action@v4.2.0
        with:
          build: yarn add -WD cypress
          start: yarn workspace @threefold/dashboard serve
          wait-on: "http://localhost:8080"
          wait-on-timeout: 60
          browser: chrome
          project: ./packages/dashboard
