Skip to content

Validate recorded snapshots in Swift workflow #4

Validate recorded snapshots in Swift workflow

Validate recorded snapshots in Swift workflow #4

name: Superfluous Snapshots
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
SWIFT_STRICT_CONCURRENCY: complete
jobs:
swift:
name: Superfluous Snapshots
runs-on: macos-13
env:
SIMULATOR: iPhone 14
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Delete snapshots
run: make delete-snapshots
- name: Resolve swift package
run: swift package resolve
- name: Resolve package dependencies
run: xcodebuild -resolvePackageDependencies
- name: Build
run: xcodebuild build-for-testing -scheme "Layout" -destination "name=$SIMULATOR,OS=latest"
- name: Test
continue-on-error: true
run: xcodebuild test-without-building -scheme "Layout" -destination "name=$SIMULATOR,OS=latest"
- name: Detect superfluous snapshots
run: |
if [ -z "$(git status --porcelain)" ]
then
echo "No superfluous snapshots detected."
else
echo "Superfluous snapshots detected."
exit 1
fi