Make onGoingOrMostRecentUpcomingEvent computed property (#313) #585
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
| name: iOS starter workflow | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "**/*.swift" | |
| - "**/*.yml" | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "**/*.swift" | |
| - "**/*.yml" | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
| name: Build default scheme using any available iPhone simulator | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install SwiftFomrat and Swiftlint | |
| run: | | |
| brew install swiftformat swiftlint | |
| - name: Cache DerivedData | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/Library/Developer/Xcode/DerivedData | |
| key: deriveddata-${{ runner.os }}-${{ hashFiles('**/*.xcodeproj', '**/*.xcworkspace', '**/Package.resolved') }} | |
| restore-keys: | | |
| deriveddata-${{ runner.os }}- | |
| - name: Debug Xcode Version | |
| run: xcodebuild -version | |
| - name: Show Swift Version | |
| run: swift --version | |
| - name: Debug Available Simulators | |
| run: xcrun simctl list devices | |
| - name: Build | |
| id: buildstep | |
| env: | |
| scheme: ${{ 'default' }} | |
| platform: ${{ 'iOS Simulator' }} | |
| run: | | |
| xcodebuild -scheme "MomCare" -project MomCare+/MomCare.xcodeproj -destination "platform=iOS Simulator,name=iPhone 17 Pro Max,OS=26.2" | |
| label-build-status: | |
| needs: build | |
| if: always() && github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add build-pass label if build succeeded | |
| if: ${{ needs.build.result == 'success' }} | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| labels: ['build-pass'] | |
| }) | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| name: 'build-fail' | |
| }).catch(e => { | |
| if (e.status !== 404) throw e | |
| }) | |
| - name: Add build-fail label if build failed | |
| if: ${{ needs.build.result == 'failure' }} | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| labels: ['build-fail'] | |
| }) | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| name: 'build-pass' | |
| }).catch(e => { | |
| if (e.status !== 404) throw e | |
| }) |