Skip to content

(Kotlin + Gradle + Plugin) updates #148

(Kotlin + Gradle + Plugin) updates

(Kotlin + Gradle + Plugin) updates #148

name: "Integration Test Github Release Version"
on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "website/**"
pull_request:
paths-ignore:
- "**/*.md"
- "website/**"
workflow_dispatch:
jobs:
build:
concurrency: "integration-test-github-release-version"
runs-on: macos-12
env:
GITHUB_PUBLISH_USER: "Touchlab-Bot"
TEST_URL: "KMMBridgeGitHubReleaseVersionTest"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "17"
- name: "Checkout sample"
uses: actions/checkout@v3
with:
repository: "touchlab/${{ env.TEST_URL }}"
ref: main
path: "build/${{ env.TEST_URL }}"
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
with:
min-wrapper-count: 2 # Validating both the local wrapper and the one in the cloned sample
- name: Apply SSH Key
uses: webfactory/ssh-agent@836c84ec59a0e7bc0eabc79988384eb567561ee2 # v0.7.0
with:
ssh-private-key: |
${{ secrets.PODSPEC_SSH_KEY }}
${{ secrets.INTEGRATION_TEST_GITHUB_RELEASE_VERSION_SSH_KEY }}
- uses: extractions/netrc@938ddbfb73b4efee33e57db13aba434b35af2f93 # v1
with:
machine: api.github.com
username: ${{ env.GITHUB_PUBLISH_USER }}
password: ${{ secrets.INTEGRATION_TEST_GITHUB_TOKEN }}
- uses: extractions/netrc@938ddbfb73b4efee33e57db13aba434b35af2f93 # v1
with:
machine: maven.pkg.github.com
username: ${{ env.GITHUB_PUBLISH_USER }}
password: ${{ secrets.INTEGRATION_TEST_GITHUB_TOKEN }}
- name: Cache build tooling
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.konan
key: ${{ runner.os }}-v4-${{ hashFiles('*.gradle.kts') }}
# TODO can we cache this so it only runs once instead of running for every test case?
- name: Local publish plugin
run: |
./gradlew publishToMavenLocal -PRELEASE_SIGNING_ENABLED=false -PVERSION_NAME=999
- name: Publish shared
run: |
cd build/${{ env.TEST_URL }}
./gradlew kmmBridgePublish -PENABLE_PUBLISHING=true -PGITHUB_PUBLISH_TOKEN=${{ secrets.INTEGRATION_TEST_GITHUB_TOKEN }} -PGITHUB_REPO=touchlab/${{ env.TEST_URL }} -PGITHUB_PUBLISH_USER=${{ env.GITHUB_PUBLISH_USER }} --no-daemon --stacktrace
env:
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"
- name: Build SPM Sample
run: |
cd build/${{ env.TEST_URL }}/ios-spm
xcodebuild -configuration Debug -scheme KmmBridgeIntegrationTestSpm -sdk iphonesimulator
- name: Build Cocoapods Sample
run: |
cd build/${{ env.TEST_URL }}/ios-cocoapods
pod install
xcodebuild -workspace KmmBridgeIntegrationTestCocoapods.xcworkspace -configuration Debug -scheme KmmBridgeIntegrationTestCocoapods -sdk iphonesimulator