diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..cb803b22 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build +on: + pull_request: + push: + branches: [ main ] # Trigger on pushes to the main branch + workflow_dispatch: + +jobs: + build: + runs-on: macos-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'corretto' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + - name: Check, Assemble Android and compile iOS + run: ./gradlew ktlintCheck assembleDebug compileKotlinIosX64 --no-daemon \ No newline at end of file diff --git a/.github/workflows/gradle-wrapper.yaml b/.github/workflows/gradle-wrapper.yaml new file mode 100644 index 00000000..8f6a8f10 --- /dev/null +++ b/.github/workflows/gradle-wrapper.yaml @@ -0,0 +1,15 @@ +name: gradle-wrapper + +on: + pull_request: + paths: + - 'gradlew' + - 'gradlew.bat' + - 'gradle/wrapper/**' + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: gradle/actions/wrapper-validation@v4 diff --git a/.github/workflows/ktlint.yml b/.github/workflows/ktlint.yml deleted file mode 100644 index c3408317..00000000 --- a/.github/workflows/ktlint.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: ktlint - -on: - pull_request: - -jobs: - ktlint: - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: "adopt" - java-version: "17" - - name: run ktlint - run: ./gradlew ktlintCheck diff --git a/android/build.gradle.kts b/android/build.gradle.kts index deb8e49d..bebac21c 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -95,3 +95,10 @@ dependencies { coreLibraryDesugaring(libs.android.desugar) } + +// Function that copies `mock` JSON config file for google-services if there isn't one available +// Google-services plugin requires this config file to build +val googleServices = file("google-services.json") +if (!googleServices.exists()) { + file("mock-google-services.json").copyTo(googleServices, overwrite = false) +} diff --git a/android/mock-google-services.json b/android/mock-google-services.json new file mode 100644 index 00000000..280d2302 --- /dev/null +++ b/android/mock-google-services.json @@ -0,0 +1,47 @@ +{ + "project_info": { + "project_number": "606665771234", + "project_id": "mock-firebase-project", + "storage_bucket": "mock-firebase-project.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:606665771229:android:c1f0f09aa42abc12", + "android_client_info": { + "package_name": "co.touchlab.droidcon.london" + } + }, + "oauth_client": [ + { + "client_id": "123455771229-sc9bpuefbjceq7i1qabk7gssstefrdlv.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "co.touchlab.droidcon.london", + "certificate_hash": "7f254b538565cfe6c28a88744985f015b1534980" + } + }, + { + "client_id": "123455771229-sc9bpuefbjceq7i1qabk7gssstefrdlv.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCNzhU2a9gMc_JHurHbywOrRI9Vj4VQZZZ" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "413392989754-04u9tv32474rj0pmbfksirt4ti02a64r.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file