Build the GTK renderer on Ubuntu on CI (#347)

* Build the GTK renderer on Ubuntu on CI

* Add `--enable-test-discovery` flag to `Makefile`

* Use OpenCombine branch w/ no Runtime dependency

* Run `sudo apt-get update` on Ubuntu hosts

* Update OpenCombine dependency

* Pin OpenCombineJS dependency

* Update label.yml
This commit is contained in:
Max Desiatov 2021-01-13 10:40:28 +00:00 committed by GitHub
parent 362be5a5fa
commit 3a0f8a8dd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 49 additions and 21 deletions

View File

@ -57,3 +57,31 @@ jobs:
brew install gtk+3
make build
gtk_ubuntu_18_04_build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build the GTK renderer on Ubuntu 18.04
shell: bash
run: |
set -ex
sudo apt-get update
sudo apt-get install libgtk+-3.0 gtk+-3.0
make build
gtk_ubuntu_20_04_build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Build the GTK renderer on Ubuntu 20.04
shell: bash
run: |
set -ex
sudo apt-get update
sudo apt-get install libgtk+-3.0 gtk+-3.0
make build

View File

@ -11,7 +11,7 @@ on:
jobs:
check-labels:
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Match PR Label

View File

@ -6,7 +6,7 @@ SWIFT_C_FLAGS ?= -Xcc $(shell echo $(C_FLAGS) | sed -e "s/ / -Xcc /g")
all: build
build:
swift build --product TokamakGTKDemo $(SWIFT_C_FLAGS) $(SWIFT_LINKER_FLAGS)
swift build --enable-test-discovery --product TokamakGTKDemo $(SWIFT_C_FLAGS) $(SWIFT_LINKER_FLAGS)
run: build
.build/debug/TokamakGTKDemo

View File

@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/TokamakUI/OpenCombine.git",
"state": {
"branch": null,
"revision": "bccff3e7c84bc559e1aa0aa9ca878400360d439d",
"version": "0.12.0-alpha2"
"revision": "eea5e707b571da14fce588000046b8ec4c62018b",
"version": "0.12.0-alpha3"
}
},
{
@ -24,8 +24,8 @@
"repositoryURL": "https://github.com/swiftwasm/OpenCombineJS.git",
"state": {
"branch": null,
"revision": "b346f955ed21ab44576e204a7554210c77f69b9b",
"version": "0.0.1"
"revision": "5e8636b15bcb4b8900696d95daaab941458ed2cf",
"version": "0.0.2"
}
},
{

View File

@ -50,8 +50,8 @@ let package = Package(
.upToNextMinor(from: "0.9.0")
),
.package(url: "https://github.com/MaxDesiatov/Runtime.git", from: "2.1.2"),
.package(url: "https://github.com/TokamakUI/OpenCombine.git", from: "0.12.0-alpha2"),
.package(url: "https://github.com/swiftwasm/OpenCombineJS.git", from: "0.0.1"),
.package(url: "https://github.com/TokamakUI/OpenCombine.git", from: "0.12.0-alpha3"),
.package(url: "https://github.com/swiftwasm/OpenCombineJS.git", .upToNextMinor(from: "0.0.2")),
],
targets: [
// Targets are the basic building blocks of a package. A target can define

View File

@ -76,10 +76,10 @@ public class MountedElement<R: Renderer> {
var typeConstructorName: String {
switch element {
case .app: fatalError("""
`App` values aren't supposed to be reconciled, thus the type constructor name is not stored \
for `App` elements. Please report this crash as a bug at \
https://github.com/swiftwasm/Tokamak/issues/new
""")
`App` values aren't supposed to be reconciled, thus the type constructor name is not stored \
for `App` elements. Please report this crash as a bug at \
https://github.com/swiftwasm/Tokamak/issues/new
""")
case let .scene(scene): return scene.typeConstructorName
case let .view(view): return view.typeConstructorName
}
@ -172,7 +172,7 @@ extension TypeInfo {
// swiftlint:disable force_try
// Extract the view from the AnyView for modification, apply Environment changes:
if genericTypes.contains(where: { $0 is EnvironmentModifier.Type }),
let modifier = try! property(named: "modifier").get(from: element) as? EnvironmentModifier
let modifier = try! property(named: "modifier").get(from: element) as? EnvironmentModifier
{
modifier.modifyEnvironment(&modifiedEnv)
}

View File

@ -99,7 +99,7 @@ extension _AnyScene {
) -> MountedScene<R> {
var title: String?
if let titledSelf = scene as? TitledScene,
let text = titledSelf.title
let text = titledSelf.title
{
title = _TextProxy(text).rawText
}

View File

@ -76,7 +76,7 @@ public struct Picker<Label: View, SelectionValue: Hashable, Content: View>: View
// update the binding.
ForEach(0..<children.count) { index in
if let forEach = mapAnyView(children[index], transform: { (v: ForEachProtocol) in v }),
forEach.elementType == SelectionValue.self
forEach.elementType == SelectionValue.self
{
let nestedChildren = forEach.children

View File

@ -20,8 +20,8 @@ import TokamakShim
public struct ColorDemo: View {
var color: Color {
guard let v0d = Double(v0),
let v1d = Double(v1),
let v2d = Double(v2)
let v1d = Double(v1),
let v2d = Double(v2)
else {
return .white
}

View File

@ -60,7 +60,7 @@ extension _OverlayModifier: WidgetAttributeModifier, WidgetModifier
"border-style": style,
"border-width": "\(overlay.shape.style.lineWidth)px",
"border-color": overlay.style.cssValue(environment),
"border-radius": "inherit"
"border-radius": "inherit",
]
}
}

View File

@ -27,12 +27,12 @@ extension AnyWidget {
struct WidgetView<Content: View>: View, AnyWidget, ParentView {
let build: (UnsafeMutablePointer<GtkApplication>) -> UnsafeMutablePointer<GtkWidget>
let update: (Widget) -> Void
let update: (Widget) -> ()
let content: Content
let expand: Bool
init(build: @escaping (UnsafeMutablePointer<GtkApplication>) -> UnsafeMutablePointer<GtkWidget>,
update: @escaping (Widget) -> Void = { _ in },
update: @escaping (Widget) -> () = { _ in },
expand: Bool = false,
@ViewBuilder content: () -> Content)
{

View File

@ -34,7 +34,7 @@ extension ModifiedContent: ViewDeferredToRenderer where Content: View, Modifier:
public var deferredBody: AnyView {
if let domModifier = modifier as? DOMViewModifier {
if let adjacentModifier = content as? AnyModifiedContent,
!(adjacentModifier.anyModifier.isOrderDependent || domModifier.isOrderDependent)
!(adjacentModifier.anyModifier.isOrderDependent || domModifier.isOrderDependent)
{
// Flatten non-order-dependent modifiers
var attr = domModifier.attributes