Validate recorded snapshots in Swift workflow #4
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: 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 |