chore(deps): update dependency react to v18 #4374
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Screenshotter | |
on: | |
push: | |
branches: [ main ] | |
pull_request_target: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
screenshotter: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
browser: [chrome, firefox, safari] | |
include: | |
- browser: chrome | |
image: selenium/standalone-chrome:3.141.59-20210422 | |
- browser: firefox | |
image: selenium/standalone-firefox:3.141.59-20210929 | |
- browser: safari | |
image: ylemkimon/selenium-proxy:latest | |
browserstack: | |
browserName: safari | |
browser_version: 13.1 | |
os: OS X | |
os_version: Catalina | |
fail-fast: false | |
services: | |
selenium: | |
image: ${{ matrix.image }} | |
env: | |
# secrets are not supported in matrix, so put it here and limit to browserstack job | |
BROWSERSTACK_USER: ${{ matrix.browserstack && secrets.BROWSERSTACK_USER }} | |
BROWSERSTACK_ACCESS_KEY: ${{ matrix.browserstack && secrets.BROWSERSTACK_ACCESS_KEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event_name == 'pull_request_target' && format('refs/pull/{0}/merge', github.event.pull_request.number) || '' }} | |
persist-credentials: false # do not persist credentials | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: yarn | |
- name: Install dependencies | |
run: yarn --immutable | |
env: | |
YARN_ENABLE_SCRIPTS: 0 # disable postinstall scripts | |
- name: Run screenshotter | |
run: | | |
TOKEN="$(cat /proc/sys/kernel/random/uuid | sha256sum | head -c 64)" | |
echo "::add-mask::$TOKEN" | |
echo "TOKEN=$TOKEN" >> $GITHUB_ENV | |
echo "::stop-commands::$TOKEN" # stop processing workflow commands | |
# run in Docker container | |
# mount .git readonly to prevent modification | |
docker run --rm \ | |
--network ${{ job.services.selenium.network }} \ | |
-v "$PWD:/code" \ | |
-v "$PWD/.git:/code/.git:ro" \ | |
-w /code \ | |
-e CI=true \ | |
node:20 \ | |
/bin/bash -c 'corepack enable && yarn node dockers/screenshotter/screenshotter.js -b ${{ matrix.browser }} --verify --diff --new --katex-ip $HOSTNAME ${{ matrix.browserstack && format('--selenium-proxy http://selenium:4445/build --browserstack --selenium-capabilities ''\''''{0}''\', toJson(matrix.browserstack)) || '--selenium-ip selenium' }}' | |
echo "::$TOKEN::" | |
timeout-minutes: 10 | |
- name: Print Selenium Docker logs | |
if: always() | |
run: | | |
echo "::stop-commands::$TOKEN" # stop processing workflow commands | |
docker logs ${{ job.services.selenium.id }} | |
echo "::$TOKEN::" | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: new-${{ matrix.browser }} | |
path: test/screenshotter/new | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: diff-${{ matrix.browser }} | |
path: test/screenshotter/diff |