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 d26dcd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
${{ runner.os }}-spm-
- name: Install Dependencies
run: brew install create-dmg
run: brew install create-dmg swiftlint
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_AUTO_UPDATE: 1
Expand Down Expand Up @@ -49,14 +49,17 @@ jobs:
fi
shell: zsh {0}

- name: Lint
run: 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 --renderer terminal
- 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
- 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 d26dcd1

Please sign in to comment.