Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test
on:
- push
- pull_request

jobs:
test:
strategy:
fail-fast: false
matrix:
lua_version: ["5.4", "5.3", "5.2", "5.1"]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Lua
uses: luarocks/gh-actions-lua@master
with:
luaVersion: ${{ matrix.lua_version }}
- name: Set up LuaRocks
uses: luarocks/gh-actions-luarocks@master
- name: Setup dependencies
run: luarocks install luaunit
- name: Build luarock
run: luarocks build streams-scm-1.rockspec
- name: Run tests
run: luarocks test
47 changes: 47 additions & 0 deletions streams-scm-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
rockspec_format = "3.0"
package = "streams"
version = "scm-1"

source = {
url = "git+https://github.com/rbaltrusch/stream.lua",
branch = "master", -- this will be replaced by the release workflow
}

description = {
summary = "Iterator-chaining library implementing common functional programming patterns such as `map`, `filter`, and `reduce`",
detailed = [[
This library provides a Java-like `Stream` class that provides a fluent interface of lazily-computed and chainable iterator operations such as `map`, `filter`, and `reduce`. For example:

```lua
local fn = require "stream"
fn.stream{2, 3, 4, 7}
:filter(function(x) return x % 2 == 0 end)
:map(function(x) return x ^ 2 end)
:collect() -- {4, 16}
```
]],
homepage = "https://github.com/rbaltrusch/stream.lua",
issues_url = "https://github.com/rbaltrusch/stream.lua/issues",
license = "MIT",
maintainer = "Richard Baltrusch",
}

dependencies = {
"lua >= 5.1"
}

test_dependencies = {
"luaunit",
}

build = {
type = "builtin",
modules = {
stream = "stream.lua",
},
}

test = {
type = "command",
script = "tests/run_tests.lua",
}
Loading