PRISM-10192 - Setup basic linting workflow for edited swift files #50
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: Verify PR | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: | |
- "main" | |
- "develop" | |
- "release/*" | |
env: | |
destination: "platform=iOS Simulator,name=iPhone 14 Pro,OS=latest" | |
configuration: "Debug" | |
noIndex: "COMPILER_INDEX_STORE_ENABLE=NO" | |
noSigning: "CODE_SIGNING_ALLOWED=NO" | |
versionXcode: "14.3.1" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Swift Lint | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Lint Edited Files | |
run: bash .github/scripts/lintEditedFiles.sh | |
risk-sdk: | |
name: Risk SDK Verification | |
runs-on: macos-13-xl | |
needs: lint | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Select Xcode | |
run: | | |
sudo xcode-select -switch /Applications/Xcode_${versionXcode}.app | |
- name: Log xcodebuild Version | |
run: | | |
xcodebuild -version | |
- name: Set git user details | |
run: | | |
# git config user.email "[email protected]" | |
# git config user.name "$GITHUB_ACTOR" | |
# git config --global --add url."[email protected]:".insteadOf "https://github.com/" | |
# git config user.email "[email protected]" | |
git config user.name "$GITHUB_ACTOR" | |
git config --global credential.helper 'cache --timeout=3600' | |
git config --global user.email "[email protected]" | |
git config --global user.name "$GITHUB_ACTOR" | |
git remote set-url origin "https://${GITHUB_ACTOR}:${{ secrets.ACCESS_TOKEN }}@github.com/${{ github.repository }}.git" | |
- name: Run Risk SDK Tests | |
run: | | |
set -o pipefail && xcodebuild -scheme "${scheme}" test -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty | |
env: | |
scheme: Risk | |
# TODO: find way of working with private repo | |
# - name: Build Risk SDK SPM Test Project | |
# run: | | |
# set -o pipefail && xcodebuild "build" "-project" "${path}" "-scheme" "${scheme}" "-configuration" "${configuration}" "-destination" "${destination}" "${noIndex}" "${noSigning}" | xcpretty | |
# env: | |
# path: "iOSExampleRiskSPM/RiskExample.xcodeproj" | |
# scheme: Risk |