Skip to content

Commit

Permalink
Get all samples building on CI (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbanes committed Apr 11, 2024
1 parent d8c2a2c commit 3b7ed85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ on:
push:
branches:
- main
- compose-mp-1.6.0
pull_request:

jobs:
build:
runs-on: macos-latest
runs-on: macos-14
timeout-minutes: 45

steps:
Expand All @@ -22,7 +21,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
java-version: 21

- uses: gradle/gradle-build-action@v2
with:
Expand All @@ -33,10 +32,13 @@ jobs:
./gradlew \
spotlessCheck \
jvmTest \
linkIosX64 \
linkIosArm64 \
:sample:android-app:assemble \
:sample:desktop-app:assemble \
-x linkDebugTestIosX64
:sample:web-js-app:assemble \
:sample:web-wasm-app:assemble \
-x linkDebugTestIosArm64 \
--no-configuration-cache
- name: Deploy to Sonatype
if: github.event_name == 'push' # only deploy for pushed commits (not PRs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package dev.chrisbanes.material3.windowsizeclass.sample

import androidx.compose.runtime.Composable
import androidx.compose.ui.window.Window
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.CanvasBasedWindow
import kotlinx.browser.document
import kotlinx.browser.window
import org.w3c.dom.HTMLCanvasElement
Expand All @@ -12,6 +13,7 @@ private const val CANVAS_ELEMENT_ID = "ComposeTarget" // Hardwired into ComposeW
/**
* A Skiko/Canvas-based top-level window using the browser's entire viewport. Supports resizing.
*/
@OptIn(ExperimentalComposeUiApi::class)
@Suppress("FunctionName")
fun BrowserViewportWindow(
title: String,
Expand Down Expand Up @@ -53,7 +55,7 @@ fun BrowserViewportWindow(
?: document.createElement("title").also { htmlHeadElement.appendChild(it) }
titleElement.textContent = title

Window(title = title) {
CanvasBasedWindow(title = title) {
content()
}
}

0 comments on commit 3b7ed85

Please sign in to comment.