diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a711a5c..a993ac8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,14 +49,19 @@ jobs: fi shell: zsh {0} + - name: Lint + run: | + brew install swiftlint + swiftlint lint --reporter github-actions-logging + - name: Debug Build if: github.event_name != 'workflow_dispatch' run: | - xcodebuild -scheme HeliPort -configuration Debug -derivedDataPath build -disableAutomaticPackageResolution CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO + set -o pipefail && xcodebuild -scheme HeliPort -configuration Debug -derivedDataPath build -disableAutomaticPackageResolution CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcbeautify - name: Release Build run: | - xcodebuild -scheme HeliPort -configuration Release -derivedDataPath build -disableAutomaticPackageResolution CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty && exit ${PIPESTATUS[0]} + set -o pipefail && xcodebuild -scheme HeliPort -configuration Release -derivedDataPath build -disableAutomaticPackageResolution CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcbeautify --renderer github-actions - name: Create Disk Image if: (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'workflow_dispatch' diff --git a/HeliPort.xcodeproj/project.pbxproj b/HeliPort.xcodeproj/project.pbxproj index 0a68b9e..98ec2ff 100644 --- a/HeliPort.xcodeproj/project.pbxproj +++ b/HeliPort.xcodeproj/project.pbxproj @@ -375,7 +375,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/zsh; - shellScript = "if [[ \"$(uname -m)\" == arm64 ]]\nthen\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif command -v swiftlint >/dev/null 2>&1\nthen\n swiftlint\nelse\n echo \"warning: `swiftlint` command not found - See https://github.com/realm/SwiftLint#installation for installation instructions.\"\nfi\n\nerrCount=0\nfor file (./HeliPort/Appearance/**/*.strings) {\n plutil -lint $file\n if [[ $file != *\"zh-Han\"* ]]; then\n local output=\"$(grep -Hn \":\" $file | cut -d: -f1-2)\"\n if [[ ! -z $output ]]; then\n ((errCount+=1))\n echo \"${output}: error: Unexpected Chinese colon\"\n fi\n fi\n}\n\nif [ $errCount -gt 0 ]; then\n exit 1\nfi\n"; + shellScript = "if [[ \"$GITHUB_ACTIONS\" != true ]]; then\n if [[ \"$(uname -m)\" == arm64 ]]\n then\n export PATH=\"/opt/homebrew/bin:$PATH\"\n fi\n\n if command -v swiftlint >/dev/null 2>&1\n then\n swiftlint\n else\n echo \"warning: `swiftlint` command not found - See https://github.com/realm/SwiftLint#installation for installation instructions.\"\n fi\nfi\n\n\nerrCount=0\nfor file (./HeliPort/Appearance/**/*.strings) {\n plutil -lint $file\n if [[ $file != *\"zh-Han\"* ]]; then\n local output=\"$(grep -Hn \":\" $file | cut -d: -f1-2)\"\n if [[ ! -z $output ]]; then\n ((errCount+=1))\n echo \"${output}: error: Unexpected Chinese colon\"\n fi\n fi\n}\n\nif [ $errCount -gt 0 ]; then\n exit 1\nfi\n"; }; /* End PBXShellScriptBuildPhase section */