-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
264 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: iOS set up | ||
description: Sets up Kotlin Native and Cocoapods | ||
runs: | ||
using: "composite" | ||
steps: | ||
- shell: bash | ||
run: ./gradlew :shared:generateDummyFramework | ||
|
||
- name: Set up cocoapods | ||
uses: maxim-lobanov/setup-cocoapods@v1 | ||
with: | ||
version: latest | ||
|
||
- shell: bash | ||
name: Install Dependencies | ||
run: | | ||
cd iosApp | ||
pod install --verbose |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Job set up | ||
description: Sets up the Java and Gradle | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: "adopt" | ||
java-version: "11" | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
shouldRunKmp: | ||
required: true | ||
type: string | ||
shouldRunAndroid: | ||
required: true | ||
type: string | ||
shouldRunIos: | ||
required: true | ||
type: string | ||
shouldRunDesktop: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
Android: | ||
if: ${{ inputs.shouldRunKmp == 'true' || inputs.shouldRunAndroid == 'true' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Job set up | ||
uses: ./.github/actions/job-set-up | ||
|
||
- run: ./gradlew :androidApp:assemble | ||
|
||
Desktop: | ||
if: ${{ inputs.shouldRunKmp == 'true' || inputs.shouldRunDesktop == 'true' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Job set up | ||
uses: ./.github/actions/job-set-up | ||
|
||
- run: ./gradlew :desktopApp:assemble | ||
|
||
iOS: | ||
if: ${{ inputs.shouldRunKmp == 'true' || inputs.shouldRunIos == 'true' }} | ||
runs-on: macos-12 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Job set up | ||
uses: ./.github/actions/job-set-up | ||
|
||
- name: iOS set up | ||
uses: ./.github/actions/ios-set-up | ||
|
||
- run: xcodebuild build -workspace iosApp/iosApp.xcworkspace -configuration Debug -scheme iosApp -sdk iphoneos -destination name='iPhone 14' -verbose |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Code review | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, ready_for_review, synchronize] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
SetUp: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: setVariables | ||
name: Set variables | ||
run: | | ||
isFromMain=${{ github.ref == 'refs/heads/main' }} | ||
isManual=${{ github.event_name == 'workflow_dispatch' }} | ||
hasKmpLabel=${{ contains(github.event.pull_request.labels.*.name, 'KMP') }} | ||
shouldRunKmp=false | ||
if $isFromMain || $isManual || $hasKmpLabel ; then | ||
shouldRunKmp=true | ||
fi | ||
echo "shouldRunKmp=$shouldRunKmp" >> "$GITHUB_OUTPUT" | ||
echo "shouldRunAndroid=${{ contains(github.event.pull_request.labels.*.name, 'Android') }}" >> "$GITHUB_OUTPUT" | ||
echo "shouldRunIos=${{ contains(github.event.pull_request.labels.*.name, 'iOS') }}" >> "$GITHUB_OUTPUT" | ||
echo "shouldRunDesktop=${{ contains(github.event.pull_request.labels.*.name, 'Desktop') }}" >> "$GITHUB_OUTPUT" | ||
if [ ${{ github.event_name }} == workflow_dispatch ] || [ ${{ github.event_name }} == push ] || ([ ${{ github.event_name }} == pull_request ] && [ ${{ github.event.pull_request.draft }} == false ]); then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi | ||
outputs: | ||
shouldRunKmp: ${{ steps.setVariables.outputs.shouldRunKmp }} | ||
shouldRunAndroid: ${{ steps.setVariables.outputs.shouldRunAndroid }} | ||
shouldRunIos: ${{ steps.setVariables.outputs.shouldRunIos }} | ||
shouldRunDesktop: ${{ steps.setVariables.outputs.shouldRunDesktop }} | ||
|
||
Build: | ||
needs: SetUp | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
shouldRunKmp: ${{ needs.SetUp.outputs.shouldRunKmp }} | ||
shouldRunAndroid: ${{ needs.SetUp.outputs.shouldRunAndroid }} | ||
shouldRunIos: ${{ needs.SetUp.outputs.shouldRunIos }} | ||
shouldRunDesktop: ${{ needs.SetUp.outputs.shouldRunDesktop }} | ||
|
||
UnitTests: | ||
needs: SetUp | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
shouldRunKmp: ${{ needs.SetUp.outputs.shouldRunKmp }} | ||
shouldRunAndroid: ${{ needs.SetUp.outputs.shouldRunAndroid }} | ||
shouldRunIos: ${{ needs.SetUp.outputs.shouldRunIos }} | ||
shouldRunDesktop: ${{ needs.SetUp.outputs.shouldRunDesktop }} | ||
|
||
AllowMerge: | ||
if: always() | ||
runs-on: ubuntu-latest | ||
needs: [ Build, UnitTests ] | ||
steps: | ||
- run: | | ||
if [ ${{ github.event_name }} == pull_request ] && [ ${{ join(github.event.pull_request.labels.*.name) == '' }} == true ]; then | ||
exit 1 | ||
elif [ ${{ (contains(needs.Build.result, 'failure')) }} == true ] || [ ${{ (contains(needs.UnitTests.result, 'failure')) }} == true ]; then | ||
exit 1 | ||
else | ||
exit 0 | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
shouldRunKmp: | ||
required: true | ||
type: string | ||
shouldRunAndroid: | ||
required: true | ||
type: string | ||
shouldRunIos: | ||
required: true | ||
type: string | ||
shouldRunDesktop: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
Android: | ||
if: ${{ inputs.shouldRunKmp == 'true' || inputs.shouldRunAndroid == 'true' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Job set up | ||
uses: ./.github/actions/job-set-up | ||
|
||
- run: ./gradlew clean testDebug -p androidApp/ | ||
|
||
Desktop: | ||
if: ${{ inputs.shouldRunKmp == 'true' || inputs.shouldRunDesktop == 'true' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Job set up | ||
uses: ./.github/actions/job-set-up | ||
|
||
- run: ./gradlew clean jvmTest -p desktopApp/ | ||
|
||
iOS: | ||
# if: ${{ inputs.shouldRunKmp == 'true' || inputs.shouldRunIos == 'true' }} | ||
if: false | ||
runs-on: macos-12 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Job set up | ||
uses: ./.github/actions/job-set-up | ||
|
||
- name: iOS set up | ||
uses: ./.github/actions/ios-set-up | ||
|
||
- run: xcodebuild build test -workspace iosApp/iosApp.xcworkspace -configuration Debug -scheme iosApp -sdk iphoneos -destination name='iPhone 14' -verbose | ||
|
||
- name: Upload logs | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: "/Users/runner/Library/Developer/Xcode/DerivedData/*" | ||
|
||
KMP-Android: | ||
if: ${{ inputs.shouldRunKmp == 'true'}} | ||
runs-on: macos-12 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Job set up | ||
uses: ./.github/actions/job-set-up | ||
|
||
- run: ./gradlew clean testDebugUnitTest -p shared/ | ||
|
||
KMP-Desktop: | ||
if: ${{ inputs.shouldRunKmp == 'true'}} | ||
runs-on: macos-12 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Job set up | ||
uses: ./.github/actions/job-set-up | ||
|
||
- run: ./gradlew clean desktopTest -p shared/ | ||
|
||
KMP-iOS: | ||
if: ${{ inputs.shouldRunKmp == 'true'}} | ||
runs-on: macos-12 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Job set up | ||
uses: ./.github/actions/job-set-up | ||
|
||
- run: if [[ $(uname -m) == 'arm64' ]]; then ./gradlew clean iosSimulatorArm64Test -p shared/; else ./gradlew clean iosX64Test -p shared/; fi |