version: 2
jobs:
  build:
    docker:
      - image: mcr.microsoft.com/playwright:bionic
    steps:
      - checkout

      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}

      - run:
          command: npm ci

      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - ./.local-browsers

      - run:
          command: |
            xvfb-run --auto-servernum npm run ctest
            xvfb-run --auto-servernum npm run wtest
            xvfb-run --auto-servernum npm run ftest
