Cehcko if file is a directory #5
Workflow file for this run
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: 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') }} |