Move Array extension to Array.swift #735
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: Swift | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer | |
jobs: | |
swift: | |
name: Swift | |
runs-on: macos-13 | |
env: | |
SIMULATOR: iPhone 14 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Validate excluded snapshots | |
run: | | |
SNAPSHOTS=$(find Tests -type d -name "__Snapshots__" | sort) | |
EXCLUDED=$(swift package dump-package | jq -r '.targets[] | select(.type == "test") | "Tests/" + .name + "/" + .exclude[]' | sort) | |
UNEXCLUDED=$(comm -23 <(echo "$SNAPSHOTS") <(echo "$EXCLUDED")) | |
if test -n "$UNEXCLUDED" | |
then | |
echo "ERROR: Snapshot directories must be excluded from Swift package:" >&2 | |
echo "$UNEXCLUDED" >&2 | |
exit 1 | |
fi | |
- name: Download swiftlint binary | |
run: swift package resolve | |
- name: Lint | |
run: | | |
DIRECTORY_NAME=$(echo "${PWD##*/}" | tr '[:upper:]' '[:lower:]') | |
"$(find ".build/artifacts/${DIRECTORY_NAME}" -type f -name swiftlint -perm +111 -print -quit)" \ | |
lint --strict --reporter github-actions-logging | |
- name: Build | |
run: xcodebuild build-for-testing -scheme "Layout" -destination "name=$SIMULATOR,OS=latest" | |
- name: Run tests | |
run: xcodebuild test-without-building -scheme "Layout" -destination "name=$SIMULATOR,OS=latest" |