Skip to content

Commit 5752857

Browse files
committed
Move from travis ci to Github actions
closes #10
1 parent 33b44ac commit 5752857

File tree

3 files changed

+35
-71
lines changed

3 files changed

+35
-71
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on: push
2+
name: Build & Test
3+
env:
4+
MIX_ENV: test
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
name: Ex${{matrix.elixir}}/OTP${{matrix.otp}}
10+
strategy:
11+
matrix:
12+
elixir: ["1.15.8", "1.16.3", "1.17.3", "1.18.2"]
13+
otp: ["25.3.2", "26.2.5", "27.2.4"]
14+
exclude:
15+
- elixir: "1.15.8"
16+
otp: "27.2.4"
17+
- elixir: "1.16.3"
18+
otp: "27.2.4"
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: erlef/setup-beam@v1
22+
with:
23+
otp-version: ${{matrix.otp}}
24+
elixir-version: ${{matrix.elixir}}
25+
- run: mix deps.get
26+
- run: mix compile --warnings-as-errors
27+
- run: mix test

.travis.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
# Scrivener.List
2-
[![Build Status](https://travis-ci.org/stephenmoloney/scrivener_list.svg)](https://travis-ci.org/stephenmoloney/scrivener_list)
32
[![Hex Version](http://img.shields.io/hexpm/v/scrivener_list.svg?style=flat)](https://hex.pm/packages/scrivener_list)
43
[![Hex docs](http://img.shields.io/badge/hex.pm-docs-green.svg?style=flat)](https://hexdocs.pm/scrivener_list)
54

65
[Scrivener.List](https://hex.pm/packages/scrivener_list) is a Scrivener compatible extension that
76
allows the pagination of a list of elements.
87

9-
## Features
8+
## Features
109

1110
1. Scrivener.List extends the protocol `Scrivener.Paginater.paginate/2` from the [scrivener](https://github.com/drewolson/scrivener) library.
1211
1. Scrivener.List also extends the function `MyApp.Repo.paginate/2` from the [scrivener_ecto](https://github.com/drewolson/scrivener_ecto) library.
13-
12+
1413
Using the second feature is entirely optional. It's provided as a convenience where the [scrivener_ecto](https://github.com/drewolson/scrivener_ecto)
1514
library is also being used in the project and gives access to the
1615
pre-configured `MyApp.Repo` module.
1716

1817
## Usage
1918

20-
## 1. Usage without a Repo module
19+
## 1. Usage without a Repo module
2120

2221
```elixir
2322
Scrivener.paginate(list, config)
@@ -41,7 +40,7 @@ Scrivener.paginate(list, config)
4140
def index(conn, params) do
4241
config = maybe_put_default_config(params)
4342

44-
page =
43+
page =
4544
["C#", "C++", "Clojure", "Elixir", "Erlang", "Go", "JAVA", "JavaScript", "Lisp",
4645
"PHP", "Perl", "Python", "Ruby", "Rust", "SQL"]
4746
|> Enum.map(&(&1 <> " " <> "language"))
@@ -62,7 +61,7 @@ defp maybe_put_default_config(_params), do: %Scrivener.Config{page_number: 1, pa
6261
```elixir
6362
list = ["C#", "C++", "Clojure", "Elixir", "Erlang", "Go", "JAVA", "JavaScript", "Lisp",
6463
"PHP", "Perl", "Python", "Ruby", "Rust", "SQL"]
65-
64+
6665
Scrivener.paginate(list, %Scrivener.Config{page_number: 1, page_size: 4}) # %Scrivener.Config{}
6766
Scrivener.paginate(list, page: 1, page_size: 4) # keyword list
6867
Scrivener.paginate(list, %{page: 1, page_size: 4}) # map
@@ -71,7 +70,7 @@ Scrivener.paginate(list, %{page: 1}) # map with only page number (page_size defa
7170

7271
## 2. Usage with a Repo module
7372

74-
Usage without a Repo is entirely optional and is added to `Scrivener.List` for convenience.
73+
Usage without a Repo is entirely optional and is added to `Scrivener.List` for convenience.
7574
Firstly, see [Scrivener.Ecto](https://github.com/drewolson/scrivener_ecto) and configure the `MyApp.Repo` module.
7675

7776
### Example Repo configuration
@@ -108,8 +107,8 @@ Example based on [scrivener_ecto](https://github.com/drewolson/scrivener_ecto) r
108107

109108
```elixir
110109
def index(conn, params) do
111-
%{age: age, name: name} = params["search"]
112-
110+
%{age: age, name: name} = params["search"]
111+
113112
page = MyApp.Person
114113
|> where([p], p.age > ^age)
115114
|> order_by([p], desc: p.age)

0 commit comments

Comments
 (0)