name: Update Storyshots
on: [workflow_dispatch]
env:
  CI: true
  PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
  PUPPETEER_EXEC_PATH: google-chrome-stable

jobs:
  functional-chromium:
    name: Chromium Functional Tests
    runs-on: ubuntu-latest
    container:
      image: ianwalter/puppeteer:3.0.0
      options: --shm-size=1g
    steps:
      - uses: actions/checkout@v2
      - uses: CultureHQ/actions-yarn@master
        with:
          args: install
      - run: yarn test:functional -u
        env:
          PUPPETEER_BROWSER: chromium
      - uses: EndBug/add-and-commit@v7
        with:
          add: 'tests/functional/__image_snapshots__/*'
          author_name: 'GitHub Actions'
          author_email: 'github-actions@github.com'
          message: 'test: update snapshot tests'
