Skip to content

Commit

Permalink
Merge pull request #2 from bow-swift/ci_linux
Browse files Browse the repository at this point in the history
Enable CI in Linux
  • Loading branch information
miguelangel-dev authored Aug 17, 2020
2 parents 1c94dee + 562bff1 commit 5dd9e24
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,32 @@ jobs:
run: sudo xcode-select -s /Applications/Xcode_11.4.1.app/Contents/Developer
- name: Run tests
run: swift test
- name: Generate linux tests
run: swift test --generate-linuxmain
- name: Cached auto-generate linux tests
uses: actions/upload-artifact@v1
with:
name: generate-linuxmain
path: Tests

linux:
name: linux
needs: macos
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Clean Tests
run: rm -rf Tests
- name: Get auto-generate linux tests
uses: actions/download-artifact@v1
with:
name: generate-linuxmain
path: Tests
- name: Remove generated artifact
uses: geekyeggo/delete-artifact@v1
with:
name: generate-linuxmain
failOnError: false
- name: Run tests
run: swift test --parallel --num-workers 4
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Swift Package Manager
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
.build
.swiftpm

# Linux - generated swift files
LinuxMain.swift
**/XCTestManifests.swift
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img src="https://github.com/bow-swift/bow-lite/workflows/Compile%20and%20test/badge.svg" alt="Compile and test" />
<img src="https://img.shields.io/badge/Swift-5.2-orange.svg" />
<img src="https://img.shields.io/badge/platforms-ipad%2Bios%2Bmac%2Blinux-brightgreen" alt="iPad + iOS + macOS + linux" />
<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>
<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>
</>

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.
Expand Down
7 changes: 3 additions & 4 deletions Tests/BowLiteCoreTests/Data/State/State+Arbitrary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import BowLiteLaws
import BowLiteCore

extension State: Arbitrary where StateType: Hashable & Arbitrary & CoArbitrary, Value: Arbitrary {

public static var arbitrary: Gen<State<StateType, Value>> {
ArrowOf<StateType, Pair<StateType, Value>>.arbitrary.map { arrow in
Gen.zip(ArrowOf<StateType, StateType>.arbitrary,
ArrowOf<StateType, Value>.arbitrary).map { f, g in
State { state in
let pair = arrow.getArrow(state)
return (pair.first, pair.second)
(f.getArrow(state), g.getArrow(state))
}
}
}
Expand Down

0 comments on commit 5dd9e24

Please sign in to comment.