Skip to content

Cehcko if file is a directory #5

Cehcko if file is a directory

Cehcko if file is a directory #5

Workflow file for this run

name: Test Actions Cache
permissions:
id-token: write
contents: write
deployments: write
on:
workflow_dispatch:
inputs:
overwrite_screenshots:
description: 'Overwrite existing screenshots with output of test run'
default: false
required: false
type: boolean
push:
branches:
- fix-github-build
jobs:
mock_screenshot_test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/cache/restore@v4
id: cache-screenshots
with:
path: ./packages/screenshot-testing/screenshots/**/*.png
key: ${{ runner.os }}-expected-screenshots-${{ hashFiles('packages/screenshot-testing/**/*.png') }}
restore-keys: |
${{ runner.os }}-expected-screenshots-${{ hashFiles('packages/screenshot-testing/**/*.png') }}
${{ runner.os }}-expected-screenshots
- name: Move screenshots
run: |
mv ./packages/screenshot-testing/screenshots ./packages/screenshot-testing/expectedScreenshots
ls ./packages/screenshot-testing/expectedScreenshots
- name: Install ImageMagick
run: |
sudo apt-get install imagemagick
- name: Extract screenshots from artifacts
run: |
./scripts/unzipArchive.sh screenshotTest ./packages/screenshot-testing/screenshots
- name: Install dependencies
run: npm install
- name: Compare Screenshots
run: |
npm run screenshot-test -w screenshot-testing
- uses: actions/cache/save@v4
if: always()
with:
path: ./packages/screenshot-testing/screenshots/**/*.png
key: ${{ runner.os }}-expected-screenshots-${{ hashFiles('packages/screenshot-testing/**/*.png') }}