From 7022840cae7831f99d2cb37b6d5b07002e6a0537 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Tue, 21 Nov 2023 14:03:58 +0100 Subject: [PATCH] add prepare.yaml github workflow --- .github/workflows/prepare.yaml | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/prepare.yaml diff --git a/.github/workflows/prepare.yaml b/.github/workflows/prepare.yaml new file mode 100644 index 0000000..361b329 --- /dev/null +++ b/.github/workflows/prepare.yaml @@ -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