Fix tests with showPassedMaintenanceChecks setting
#134
This file contains hidden or 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
| # | |
| # © 2024 F1248 <f1248@mailbox.org> | |
| # See LICENSE.txt for license information. | |
| # | |
| name: Build app | |
| on: | |
| push: | |
| branches-ignore: stable | |
| paths: | |
| - .github/workflows/Build-app.yml | |
| - .periphery.yml | |
| - .swiftformat | |
| - .swiftlint.yml | |
| - Genius/** | |
| - Genius.xcconfig | |
| - Genius.xcodeproj/** | |
| - GeniusTests/** | |
| - Install | |
| - Makefile | |
| tags: "**" | |
| pull_request: | |
| branches-ignore: stable | |
| paths: | |
| - .github/workflows/Build-app.yml | |
| - .periphery.yml | |
| - .swiftformat | |
| - .swiftlint.yml | |
| - Genius/** | |
| - Genius.xcconfig | |
| - Genius.xcodeproj/** | |
| - GeniusTests/** | |
| - Install | |
| - Makefile | |
| workflow_dispatch: | |
| permissions: {} | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| NSUnbufferedIO: YES | |
| defaults: | |
| run: | |
| shell: bash | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| Build-app: | |
| name: Build app | |
| permissions: | |
| attestations: write | |
| id-token: write | |
| runs-on: macos-26 | |
| steps: | |
| - name: Free up disk space | |
| run: sudo rm -r /System/Library/AssetsV2/com_apple_MobileAsset_*OSSimulatorRuntime | |
| - name: Checkout | |
| uses: actions/checkout@main | |
| with: | |
| fetch-depth: 0 | |
| - name: Install create-dmg | |
| if: github.ref_type == 'tag' | |
| run: | | |
| npm install --global create-dmg | |
| echo "create-dmg $(create-dmg --version) installed" | |
| - name: Install Periphery | |
| run: | | |
| tag=$(gh release --repo peripheryapp/periphery list --json tagName --jq ".[0].tagName") | |
| curl \ | |
| https://github.com/peripheryapp/periphery/releases/download/"$tag"/periphery-"$tag".zip \ | |
| --location \ | |
| --output periphery.zip | |
| unzip periphery.zip | |
| echo "Periphery $(./periphery version) installed" | |
| - name: Install SwiftFormat | |
| run: | | |
| curl \ | |
| https://github.com/nicklockwood/SwiftFormat/releases/latest/download/swiftformat.zip \ | |
| --location \ | |
| --remote-name | |
| unzip swiftformat.zip | |
| echo "SwiftFormat $(./swiftformat --version) installed" | |
| - name: Install SwiftLint | |
| run: | | |
| curl \ | |
| https://github.com/realm/SwiftLint/releases/latest/download/portable_swiftlint.zip \ | |
| --location \ | |
| --remote-name | |
| unzip portable_swiftlint.zip | |
| echo "SwiftLint $(./swiftlint version) installed" | |
| - name: Install xcbeautify | |
| run: | | |
| tag=$(gh release --repo cpisciotta/xcbeautify list --json tagName --jq ".[0].tagName") | |
| curl \ | |
| https://github.com/cpisciotta/xcbeautify/releases/download/"$tag"/xcbeautify-"$tag"-arm64-apple-macosx.zip \ | |
| --location \ | |
| --output xcbeautify.zip | |
| unzip xcbeautify.zip | |
| echo "xcbeautify $(./xcbeautify --version) installed" | |
| - name: Run SwiftFormat | |
| run: make swiftformat | |
| - name: Run SwiftLint lint rules | |
| run: make swiftlint-lint | |
| - name: Select latest installed Xcode version | |
| uses: maxim-lobanov/setup-xcode@master | |
| with: | |
| xcode-version: latest | |
| - name: Checkout Build.txt from Xcode mirror | |
| uses: actions/checkout@main | |
| with: | |
| repository: F1248/Xcode-Mirror | |
| token: ${{ secrets.XCODE_MIRROR_TOKEN }} | |
| path: Xcode-Mirror | |
| sparse-checkout: Build.txt | |
| sparse-checkout-cone-mode: false | |
| - name: Check if latest Xcode version is installed | |
| run: | | |
| if [[ "$(xcodebuild -version | sed -n "s/Build version //p")" == "$(cat Xcode-Mirror/Build.txt)" ]]; then | |
| echo "latest_xcode_version_installed=true" >> "$GITHUB_ENV" | |
| else | |
| echo "latest_xcode_version_installed=false" >> "$GITHUB_ENV" | |
| fi | |
| - name: Checkout Xcode mirror | |
| if: env.latest_xcode_version_installed == 'false' | |
| uses: actions/checkout@main | |
| with: | |
| repository: F1248/Xcode-Mirror | |
| token: ${{ secrets.XCODE_MIRROR_TOKEN }} | |
| path: Xcode-Mirror | |
| sparse-checkout: Xcode.xip-* | |
| - name: Install unxip | |
| if: env.latest_xcode_version_installed == 'false' | |
| run: | | |
| curl https://github.com/saagarjha/unxip/releases/latest/download/unxip --location --remote-name | |
| chmod +x unxip | |
| echo "$(./unxip --version) installed" | |
| - name: Install and select Xcode | |
| if: env.latest_xcode_version_installed == 'false' | |
| run: | | |
| cat Xcode-Mirror/Xcode.xip-* | ./unxip - | |
| sudo xcode-select --switch Xcode*.app | |
| - name: Prepare Xcode | |
| run: | | |
| sudo xcodebuild -license accept | |
| sudo xcodebuild -runFirstLaunch | |
| echo "$(xcodebuild -version | tr "\n" " ")selected" | |
| - name: Run Periphery | |
| run: make periphery | |
| - name: Build for testing | |
| run: make build-for-testing-keep-log | |
| - name: Run SwiftLint analyzer rules | |
| run: make swiftlint-analyze-log-exists | |
| - name: Run tests | |
| run: make test-without-building | |
| - name: Build app | |
| run: make build | |
| - name: Zip app | |
| run: make zip-app | |
| - name: Attest build provenance of Genius.zip | |
| uses: actions/attest-build-provenance@main | |
| with: | |
| subject-path: Genius.zip | |
| - name: Upload Genius.zip | |
| uses: actions/upload-artifact@main | |
| with: | |
| name: Genius # omit `.zip` file extension as it will be added automatically | |
| path: Genius.zip | |
| - name: Create DMG file | |
| if: github.ref_type == 'tag' | |
| run: make create-dmg | |
| - name: Attest build provenance of Genius.dmg | |
| if: github.ref_type == 'tag' | |
| uses: actions/attest-build-provenance@main | |
| with: | |
| subject-path: Genius.dmg | |
| - name: Upload Genius.dmg | |
| if: github.ref_type == 'tag' | |
| uses: actions/upload-artifact@main | |
| with: | |
| name: Genius.dmg | |
| path: Genius.dmg | |
| - name: Zip debug symbols | |
| run: make zip-debug-symbols | |
| - name: Upload Debug-Symbols.zip | |
| uses: actions/upload-artifact@main | |
| with: | |
| name: Debug-Symbols # omit `.zip` file extension as it will be added automatically | |
| path: Debug-Symbols.zip |