Skip to content

Commit

Permalink
CI: Migrate to xcbeautify & update swiftlint
Browse files Browse the repository at this point in the history
xcpretty is no longer provided in GitHub Actions runners
swiftlint now supports GitHub Actions style logging, run as a task separately
  • Loading branch information
williambj1 committed Jun 17, 2024
1 parent 778bd69 commit 8c9ba0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion HeliPort.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 8c9ba0e

Please sign in to comment.