Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Decompose Router APIs for pages and slots #85

Merged
merged 11 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/actions/get-avd-info/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Get AVD Info'
description: 'Get the AVD info based on its API level.'
inputs:
api-level:
required: true
outputs:
arch:
value: ${{ steps.get-avd-arch.outputs.arch }}
target:
value: ${{ steps.get-avd-target.outputs.target }}
runs:
using: "composite"
steps:
- id: get-avd-arch
run: echo "arch=$(if [ ${{ inputs.api-level }} -ge 30 ]; then echo x86_64; else echo x86; fi)" >> $GITHUB_OUTPUT
shell: bash
- id: get-avd-target
run: echo "target=$(echo default)" >> $GITHUB_OUTPUT
shell: bash
72 changes: 62 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,85 @@ jobs:
strategy:
matrix:
config: [
{ target: jvm, os: ubuntu-latest },
{ target: apple, os: macos-latest },
{ target: android, os: ubuntu-latest, tasks: testDebugUnitTest testReleaseUnitTest },
{ target: ios, os: macos-latest, tasks: iosX64Test iosSimulatorArm64Test },
{ target: js, os: ubuntu-latest, tasks: jsTest },
{ target: desktop, os: ubuntu-latest, tasks: desktopTest },
]
runs-on: ${{ matrix.config.os }}
needs:
- check
name: Build ${{ matrix.config.target }}
needs: check
steps:
- uses: actions/checkout@v3
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Setup gradle
uses: gradle/gradle-build-action@v2

- name: Test ${{ matrix.config.target }} targets
run: ./gradlew ${{ matrix.config.tasks }}

test:
name: Test on Android
runs-on: ubuntu-latest
timeout-minutes: 60
needs: check
strategy:
fail-fast: true
matrix:
api-level: [ 25, 33, 34 ]

steps:
- uses: actions/checkout@v3
- name: set up JDK 17

- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build

# API 30+ emulators only have x86_64 system images.
- name: Get AVD info
uses: ./.github/actions/get-avd-info
id: avd-info
with:
api-level: ${{ matrix.api-level }}

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ steps.avd-info.outputs.arch }}
target: ${{ steps.avd-info.outputs.target }}
script: ./gradlew connectedDebugAndroidTest

release:
name: Release to sonatype
if: ${{ github.event_name != 'pull_request' }}
runs-on: macos-latest
needs:
- build
- test
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down Expand Up @@ -107,6 +158,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- build
- test
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand All @@ -132,15 +184,15 @@ jobs:
uses: JetBrains/writerside-github-action@v4
with:
instance: docs/decompose-router
artifact: webHelpKSTORE2-all.zip
artifact: webHelpDECOMPOSE-ROUTER2-all.zip
docker-version: 232.10275

- name: Upload documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: |
artifacts/webHelpKSTORE2-all.zip
artifacts/webHelpDECOMPOSE-ROUTER2-all.zip
artifacts/report.json
retention-days: 7

Expand All @@ -161,4 +213,4 @@ jobs:

- name: Release to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v1
37 changes: 0 additions & 37 deletions .github/workflows/test.yml

This file was deleted.

25 changes: 4 additions & 21 deletions .idea/runConfigurations/ios.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ kotlin {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.materialIconsExtended)

implementation(libs.decompose)
implementation(libs.decompose.compose.multiplatform)
Expand Down Expand Up @@ -107,7 +108,7 @@ android {
namespace = "io.github.xxfast.decompose.router.app"
compileSdk = 34
defaultConfig {
minSdk = 21
minSdk = 25
targetSdk = 34
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -141,4 +142,4 @@ compose.desktop {

compose.experimental {
web.application { }
}
}
4 changes: 2 additions & 2 deletions app/ios/ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
"-framework",
app,
);
PRODUCT_BUNDLE_IDENTIFIER = io.github.xxfast.decompose.router.app;
PRODUCT_BUNDLE_IDENTIFIER = io.github.xxfast.decompose.router.sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -355,7 +355,7 @@
"-framework",
app,
);
PRODUCT_BUNDLE_IDENTIFIER = io.github.xxfast.decompose.router.app;
PRODUCT_BUNDLE_IDENTIFIER = io.github.xxfast.decompose.router.sample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
77 changes: 77 additions & 0 deletions app/ios/ios.xcodeproj/xcshareddata/xcschemes/ios.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7555FF7A242A565900829871"
BuildableName = "ios.app"
BlueprintName = "ios"
ReferencedContainer = "container:ios.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7555FF7A242A565900829871"
BuildableName = "ios.app"
BlueprintName = "ios"
ReferencedContainer = "container:ios.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7555FF7A242A565900829871"
BuildableName = "ios.app"
BlueprintName = "ios"
ReferencedContainer = "container:ios.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading