Skip to content

Commit

Permalink
add prepare.yaml github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Nov 21, 2023
1 parent f61ea25 commit 7022840
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/prepare.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: patrol prepare

on:
workflow_dispatch:
pull_request:

jobs:
prepare-ios:
runs-on: ${{ matrix.os }}
name: iOS on ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-latest]

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install tools
run: |
brew update
brew install swift-format
brew install clang-format
brew install xcbeautify
- name: swift-format lint
run: test -z $(swift-format lint --recursive --strict .)

- name: swift-format format
if: success() || failure()
run: |
swift-format format --recursive --in-place .
git update-index --refresh
git diff-index --quiet HEAD --
- name: clang-format
if: success() || failure()
run: |
find . -iname '*.h' -o -iname '*.m' \
| xargs -I {} clang-format --dry-run --Werror {}
- name: Start iOS simulator
uses: futureware-tech/simulator-action@v2
with:
model: iPhone 14
os: iOS
os_version: 16.2
erase_before_boot: true
shutdown_after_job: true

- name: Run UI tests
run: |
set -o pipefail
xcodebuild test \
-workspace Landmarks.xcworkspace \
-scheme Landmarks \
-only-testing LandmarksUITests \
-configuration Debug \
-sdk iphoneos -destination 'platform=iOS Simulator,name=iPhone 14' \
| xcbeautify --renderer github-actions

0 comments on commit 7022840

Please sign in to comment.