Skip to content

Commit 5dd9e24

Browse files
Merge pull request #2 from bow-swift/ci_linux
Enable CI in Linux
2 parents 1c94dee + 562bff1 commit 5dd9e24

File tree

4 files changed

+39
-6
lines changed

4 files changed

+39
-6
lines changed

.github/workflows/swift.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,32 @@ jobs:
1313
run: sudo xcode-select -s /Applications/Xcode_11.4.1.app/Contents/Developer
1414
- name: Run tests
1515
run: swift test
16+
- name: Generate linux tests
17+
run: swift test --generate-linuxmain
18+
- name: Cached auto-generate linux tests
19+
uses: actions/upload-artifact@v1
20+
with:
21+
name: generate-linuxmain
22+
path: Tests
23+
24+
linux:
25+
name: linux
26+
needs: macos
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Clean Tests
32+
run: rm -rf Tests
33+
- name: Get auto-generate linux tests
34+
uses: actions/download-artifact@v1
35+
with:
36+
name: generate-linuxmain
37+
path: Tests
38+
- name: Remove generated artifact
39+
uses: geekyeggo/delete-artifact@v1
40+
with:
41+
name: generate-linuxmain
42+
failOnError: false
43+
- name: Run tests
44+
run: swift test --parallel --num-workers 4

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
# Swift Package Manager
12
.DS_Store
2-
/.build
33
/Packages
44
/*.xcodeproj
55
xcuserdata/
6+
.build
67
.swiftpm
8+
9+
# Linux - generated swift files
10+
LinuxMain.swift
11+
**/XCTestManifests.swift

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<img src="https://github.com/bow-swift/bow-lite/workflows/Compile%20and%20test/badge.svg" alt="Compile and test" />
55
<img src="https://img.shields.io/badge/Swift-5.2-orange.svg" />
66
<img src="https://img.shields.io/badge/platforms-ipad%2Bios%2Bmac%2Blinux-brightgreen" alt="iPad + iOS + macOS + linux" />
7-
<a href="https://badge.bow-swift.io/recipe?name=bow-lite&description=Bow%20Lite%20is%20a%20cross-platform%20library%20for%20Typed%20Functional%20Programming%20in%20Swift&url=https://github.com/bow-swift/bow-lite&owner=bow-swift&avatar=https://avatars3.githubusercontent.com/u/44965417?v=4&branch=main"><img src="https://raw.githubusercontent.com/bow-swift/bow-art/master/badges/nef-playgrounds-badge.svg" alt="bow-lite Playground" style="height:20px"></a>
7+
<a href="https://badge.bow-swift.io/recipe?name=bow-lite&description=Bow%20Lite%20is%20a%20cross-platform%20library%20for%20Typed%20Functional%20Programming%20in%20Swift&url=https://github.com/bow-swift/bow-lite&owner=bow-swift&avatar=https://avatars3.githubusercontent.com/u/44965417?v=4&tag=0.1.0"><img src="https://raw.githubusercontent.com/bow-swift/bow-art/master/badges/nef-playgrounds-badge.svg" alt="bow-lite Playground" style="height:20px"></a>
88
</>
99

1010
Bow Lite is a cross-platform library for Typed Functional Programming in Swift. It is a lightweight version of [Bow](https://github.com/bow-swift/bow) where some complexity, like Higher Kinded Type emulation, has been removed.

Tests/BowLiteCoreTests/Data/State/State+Arbitrary.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ import BowLiteLaws
33
import BowLiteCore
44

55
extension State: Arbitrary where StateType: Hashable & Arbitrary & CoArbitrary, Value: Arbitrary {
6-
76
public static var arbitrary: Gen<State<StateType, Value>> {
8-
ArrowOf<StateType, Pair<StateType, Value>>.arbitrary.map { arrow in
7+
Gen.zip(ArrowOf<StateType, StateType>.arbitrary,
8+
ArrowOf<StateType, Value>.arbitrary).map { f, g in
99
State { state in
10-
let pair = arrow.getArrow(state)
11-
return (pair.first, pair.second)
10+
(f.getArrow(state), g.getArrow(state))
1211
}
1312
}
1413
}

0 commit comments

Comments
 (0)