mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 14:59:53 +02:00
Fix cache save
This commit is contained in:
33
.github/workflows/e2e.yml
vendored
33
.github/workflows/e2e.yml
vendored
@@ -108,34 +108,38 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
if: ${{ failure() && steps.cypress.conclusion == 'failure' }}
|
if: ${{ failure() && steps.cypress.conclusion == 'failure' }}
|
||||||
with:
|
with:
|
||||||
name: error-snapshots-${{ matrix.containers }}
|
name: snapshots-${{ matrix.containers }}
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
path: cypress/snapshots/**/__diff_output__/*
|
|
||||||
|
|
||||||
- name: Save snapshots cache
|
|
||||||
id: cache-upload
|
|
||||||
if: ${{ github.event_name == 'push' }}
|
|
||||||
uses: actions/cache/save@v3
|
|
||||||
with:
|
|
||||||
path: ./cypress/snapshots
|
path: ./cypress/snapshots
|
||||||
key: ${{ runner.os }}-snapshots-${{ github.event.after }}
|
|
||||||
|
|
||||||
combineArtifacts:
|
combineArtifacts:
|
||||||
needs: e2e
|
needs: e2e
|
||||||
if: ${{ failure() }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Download All Artifacts
|
- name: Download All Artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: snapshots
|
path: snapshots
|
||||||
pattern: error-snapshots-*
|
pattern: snapshots-*
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- run: |
|
|
||||||
|
- name: Save snapshots cache
|
||||||
|
id: cache-upload
|
||||||
|
if: ${{ github.event_name == 'push' }}
|
||||||
|
uses: actions/cache/save@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
./cypress/snapshots
|
||||||
|
!./**/__diff_output__/*
|
||||||
|
key: ${{ runner.os }}-snapshots-${{ github.event.after }}
|
||||||
|
|
||||||
|
- if: ${{ failure() }}
|
||||||
|
run: |
|
||||||
mkdir errors
|
mkdir errors
|
||||||
cd snapshots
|
cd snapshots
|
||||||
find . -mindepth 2 -type f -print -exec mv {} ../errors/ \;
|
find . -mindepth 2 -type d -name "*__diff_output__*" -exec sh -c 'mv "$0"/*.png ../errors/' {} \;
|
||||||
- name: Upload Artifacts
|
- name: Upload Error snapshots
|
||||||
|
if: ${{ failure() }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
id: upload-artifacts
|
id: upload-artifacts
|
||||||
with:
|
with:
|
||||||
@@ -143,6 +147,7 @@ jobs:
|
|||||||
retention-days: 10
|
retention-days: 10
|
||||||
path: errors/
|
path: errors/
|
||||||
- name: Notify Users
|
- name: Notify Users
|
||||||
|
if: ${{ failure() }}
|
||||||
run: |
|
run: |
|
||||||
echo "::error,title=Visual tests failed::You can view images that failed by downloading the error-snapshots artifact: ${{ steps.upload-artifacts.outputs.artifact-url }}"
|
echo "::error,title=Visual tests failed::You can view images that failed by downloading the error-snapshots artifact: ${{ steps.upload-artifacts.outputs.artifact-url }}"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user