mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Only run Compound tests when files are changed in Compound. (#4611)
* Only run Compound tests when files are changed in Compound. * Fix warnings about missing spacing. * Fix warnings about inner type shadowing.
This commit is contained in:
@@ -6,8 +6,10 @@ name: Compound
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ develop ]
|
branches: [ develop ]
|
||||||
|
paths: [ 'compound-ios/**' ]
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths: [ 'compound-ios/**' ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
@@ -15,8 +17,9 @@ jobs:
|
|||||||
runs-on: macos-15
|
runs-on: macos-15
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
# Only allow a single run of this workflow on each branch, automatically cancelling older runs.
|
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
|
||||||
group: ${{ format('compound-tests-{0}', github.ref) }}
|
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
|
||||||
|
group: ${{ github.ref == 'refs/heads/develop' && format('compound-develop-{0}', github.sha) || format('compound-{0}', github.ref) }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ public struct CompoundButtonStyle_Previews: PreviewProvider, TestablePreview {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static func buttons(_ size: CompoundButtonStyle.Size) -> some View {
|
public static func buttons(_ size: CompoundButtonStyle.Size) -> some View {
|
||||||
VStack {
|
VStack(spacing: 8) {
|
||||||
Button("Super") { }
|
Button("Super") { }
|
||||||
.buttonStyle(.compound(.super, size: size))
|
.buttonStyle(.compound(.super, size: size))
|
||||||
|
|
||||||
|
|||||||
@@ -168,9 +168,9 @@ struct CompoundIcon_Previews: PreviewProvider, TestablePreview {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static var accessibilityIcons: some View {
|
static var accessibilityIcons: some View {
|
||||||
VStack {
|
VStack(spacing: 8) {
|
||||||
ForEach(DynamicTypeSize.allCases, id: \.self) { size in
|
ForEach(DynamicTypeSize.allCases, id: \.self) { size in
|
||||||
HStack {
|
HStack(spacing: 8) {
|
||||||
CompoundIcon(\.userProfile, size: .xSmall, relativeTo: .compound.bodyXS)
|
CompoundIcon(\.userProfile, size: .xSmall, relativeTo: .compound.bodyXS)
|
||||||
CompoundIcon(\.userProfile, size: .small, relativeTo: .compound.bodySM)
|
CompoundIcon(\.userProfile, size: .small, relativeTo: .compound.bodySM)
|
||||||
CompoundIcon(\.userProfile, size: .medium, relativeTo: .compound.bodyLG)
|
CompoundIcon(\.userProfile, size: .medium, relativeTo: .compound.bodyLG)
|
||||||
@@ -219,7 +219,7 @@ struct CompoundIcon_Previews: PreviewProvider, TestablePreview {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static var buttons: some View {
|
static var buttons: some View {
|
||||||
VStack {
|
VStack(spacing: 8) {
|
||||||
Button { } label: {
|
Button { } label: {
|
||||||
Label { Text("Body Large") } icon: {
|
Label { Text("Body Large") } icon: {
|
||||||
CompoundIcon(\.userProfile, size: .medium, relativeTo: .compound.bodyLG)
|
CompoundIcon(\.userProfile, size: .medium, relativeTo: .compound.bodyLG)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ private struct ScaledFrameModifier: ViewModifier {
|
|||||||
|
|
||||||
struct ScaledFrameModifier_Previews: PreviewProvider, TestablePreview {
|
struct ScaledFrameModifier_Previews: PreviewProvider, TestablePreview {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
VStack {
|
VStack(spacing: 8) {
|
||||||
ForEach(DynamicTypeSize.allCases, id: \.self) { size in
|
ForEach(DynamicTypeSize.allCases, id: \.self) { size in
|
||||||
likeButtonLabel
|
likeButtonLabel
|
||||||
.dynamicTypeSize(size)
|
.dynamicTypeSize(size)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ private struct ScaledOffsetModifier: ViewModifier {
|
|||||||
|
|
||||||
struct ScaledOffsetModifier_Previews: PreviewProvider, TestablePreview {
|
struct ScaledOffsetModifier_Previews: PreviewProvider, TestablePreview {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
VStack {
|
VStack(spacing: 8) {
|
||||||
ForEach(DynamicTypeSize.allCases, id: \.self) { size in
|
ForEach(DynamicTypeSize.allCases, id: \.self) { size in
|
||||||
verifiedUserComposite
|
verifiedUserComposite
|
||||||
.dynamicTypeSize(size)
|
.dynamicTypeSize(size)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ private struct ScaledPaddingModifier: ViewModifier {
|
|||||||
|
|
||||||
struct ScaledPaddingModifier_Previews: PreviewProvider, TestablePreview {
|
struct ScaledPaddingModifier_Previews: PreviewProvider, TestablePreview {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
VStack {
|
VStack(spacing: 8) {
|
||||||
ForEach(DynamicTypeSize.allCases, id: \.self) { size in
|
ForEach(DynamicTypeSize.allCases, id: \.self) { size in
|
||||||
userProfileButtonLabel
|
userProfileButtonLabel
|
||||||
.dynamicTypeSize(size)
|
.dynamicTypeSize(size)
|
||||||
|
|||||||
@@ -27,19 +27,19 @@ public struct ListRow<Icon: View, DetailsIcon: View, CustomContent: View, Select
|
|||||||
let label: ListRowLabel<Icon>
|
let label: ListRowLabel<Icon>
|
||||||
let details: ListRowDetails<DetailsIcon>?
|
let details: ListRowDetails<DetailsIcon>?
|
||||||
|
|
||||||
public enum Kind<CustomContent: View, SelectionValue: Hashable> {
|
public enum Kind<CustomView: View, Selection: Hashable> {
|
||||||
case label
|
case label
|
||||||
case button(action: () -> Void)
|
case button(action: () -> Void)
|
||||||
case navigationLink(action: () -> Void)
|
case navigationLink(action: () -> Void)
|
||||||
case picker(selection: Binding<SelectionValue>, items: [(title: String, tag: SelectionValue)])
|
case picker(selection: Binding<Selection>, items: [(title: String, tag: Selection)])
|
||||||
case toggle(Binding<Bool>)
|
case toggle(Binding<Bool>)
|
||||||
case inlinePicker(selection: Binding<SelectionValue>, items: [(title: String, tag: SelectionValue)])
|
case inlinePicker(selection: Binding<Selection>, items: [(title: String, tag: Selection)])
|
||||||
case selection(isSelected: Bool, action: () -> Void)
|
case selection(isSelected: Bool, action: () -> Void)
|
||||||
case multiSelection(isSelected: Bool, action: () -> Void)
|
case multiSelection(isSelected: Bool, action: () -> Void)
|
||||||
case textField(text: Binding<String>, axis: Axis?)
|
case textField(text: Binding<String>, axis: Axis?)
|
||||||
case secureField(text: Binding<String>)
|
case secureField(text: Binding<String>)
|
||||||
|
|
||||||
case custom(() -> CustomContent)
|
case custom(() -> CustomView)
|
||||||
|
|
||||||
public static func textField(text: Binding<String>) -> Self {
|
public static func textField(text: Binding<String>) -> Self {
|
||||||
.textField(text: text, axis: nil)
|
.textField(text: text, axis: nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user