Skip to content
Draft
38 changes: 38 additions & 0 deletions .github/workflows/test-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Upload Test Artifacts

on:
workflow_call:
inputs:
artifact-name:
required: false
type: string
default: 'failed-test-screenshots'
artifact-path:
required: false
type: string
# More robust default: upload all PNGs found anywhere
default: '**/*.png'
retention-days:
required: false
type: number
default: 14

jobs:
upload-test-artifacts:
runs-on: ubuntu-latest
steps:
- name: Print workspace location
run: pwd

- name: Upload screenshots from failed tests
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: ${{ inputs.artifact-path }}
if-no-files-found: ignore
retention-days: ${{ inputs.retention-days }}
- name: List all files in workspace
run: ls -lR

- name: List all PNG files recursively
run: find . -name '*.png' -print