Skip to content

Commit 5b6a8ee

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

File tree

6 files changed

+57
-92
lines changed

6 files changed

+57
-92
lines changed

.github/workflows/ci.yml

+27
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
27+
- run: mix test

.travis.yml

-62
This file was deleted.

README.md

+8-9
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)

config/config.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use Mix.Config
1+
import Config
22

33
if Mix.env() == :test do
44
config :scrivener_list, Scrivener.Repo, adapter: Ecto.Adapters.Postgres

mix.exs

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule Scrivener.List.Mixfile do
1212
version: @version,
1313
source_url: @source_url,
1414
homepage_url: @homepage_url,
15-
elixir: "~> 1.3",
15+
elixir: "~> 1.9",
1616
build_embedded: Mix.env() == :prod,
1717
start_permanent: Mix.env() == :prod,
1818
description: description(),
@@ -28,13 +28,13 @@ defmodule Scrivener.List.Mixfile do
2828

2929
defp deps() do
3030
[
31-
{:scrivener_ecto, "~> 1.0 or ~> 2.0 or ~> 3.0"},
31+
{:scrivener_ecto, "~> 3.0", optional: true},
3232

3333
# dev/test
34-
{:earmark, "~> 1.3", only: :dev, runtime: false},
35-
{:ex_doc, "~> 0.19", only: :dev, runtime: false},
34+
{:earmark, "~> 1.4.0", only: :dev, runtime: false},
35+
{:ex_doc, "~> 0.37.0", only: :dev, runtime: false},
3636
{:postgrex, ">= 0.0.0", only: :test},
37-
{:ecto_sql, "~> 3.0", only: :test}
37+
{:ecto_sql, "~> 3.12.0", only: :test}
3838
]
3939
end
4040

mix.lock

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
%{
2-
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"},
3-
"db_connection": {:hex, :db_connection, "2.0.5", "ddb2ba6761a08b2bb9ca0e7d260e8f4dd39067426d835c24491a321b7f92a4da", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"},
4-
"decimal": {:hex, :decimal, "1.6.0", "bfd84d90ff966e1f5d4370bdd3943432d8f65f07d3bab48001aebd7030590dcc", [:mix], [], "hexpm"},
5-
"earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm"},
6-
"ecto": {:hex, :ecto, "3.0.7", "44dda84ac6b17bbbdeb8ac5dfef08b7da253b37a453c34ab1a98de7f7e5fec7f", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm"},
7-
"ecto_sql": {:hex, :ecto_sql, "3.0.5", "7e44172b4f7aca4469f38d7f6a3da394dbf43a1bcf0ca975e958cb957becd74e", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.0.6", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.3.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"},
8-
"ex_doc": {:hex, :ex_doc, "0.19.3", "3c7b0f02851f5fc13b040e8e925051452e41248f685e40250d7e40b07b9f8c10", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
9-
"makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"},
10-
"makeup_elixir": {:hex, :makeup_elixir, "0.13.0", "be7a477997dcac2e48a9d695ec730b2d22418292675c75aa2d34ba0909dcdeda", [:mix], [{:makeup, "~> 0.8", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"},
11-
"nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"},
12-
"poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [:rebar], []},
13-
"postgrex": {:hex, :postgrex, "0.14.1", "63247d4a5ad6b9de57a0bac5d807e1c32d41e39c04b8a4156a26c63bcd8a2e49", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
14-
"scrivener": {:hex, :scrivener, "2.6.0", "b6baf40e9eac69cdc5773e37dd60c6f8b282dd676564048fa29a47e63583f562", [:mix], [], "hexpm"},
15-
"scrivener_ecto": {:hex, :scrivener_ecto, "2.0.0", "e6ee5cc49b44e6115029185f07ffddd7e78475aa40394e98219800fed18f8e42", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:scrivener, "~> 2.4", [hex: :scrivener, repo: "hexpm", optional: false]}], "hexpm"},
16-
"telemetry": {:hex, :telemetry, "0.3.0", "099a7f3ce31e4780f971b4630a3c22ec66d22208bc090fe33a2a3a6a67754a73", [:rebar3], [], "hexpm"},
2+
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
3+
"db_connection": {:hex, :db_connection, "2.7.0", "b99faa9291bb09892c7da373bb82cba59aefa9b36300f6145c5f201c7adf48ec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dcf08f31b2701f857dfc787fbad78223d61a32204f217f15e881dd93e4bdd3ff"},
4+
"decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"},
5+
"earmark": {:hex, :earmark, "1.4.47", "7e7596b84fe4ebeb8751e14cbaeaf4d7a0237708f2ce43630cfd9065551f94ca", [:mix], [], "hexpm", "3e96bebea2c2d95f3b346a7ff22285bc68a99fbabdad9b655aa9c6be06c698f8"},
6+
"earmark_parser": {:hex, :earmark_parser, "1.4.43", "34b2f401fe473080e39ff2b90feb8ddfeef7639f8ee0bbf71bb41911831d77c5", [:mix], [], "hexpm", "970a3cd19503f5e8e527a190662be2cee5d98eed1ff72ed9b3d1a3d466692de8"},
7+
"ecto": {:hex, :ecto, "3.12.5", "4a312960ce612e17337e7cefcf9be45b95a3be6b36b6f94dfb3d8c361d631866", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6eb18e80bef8bb57e17f5a7f068a1719fbda384d40fc37acb8eb8aeca493b6ea"},
8+
"ecto_sql": {:hex, :ecto_sql, "3.12.1", "c0d0d60e85d9ff4631f12bafa454bc392ce8b9ec83531a412c12a0d415a3a4d0", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "aff5b958a899762c5f09028c847569f7dfb9cc9d63bdb8133bff8a5546de6bf5"},
9+
"ex_doc": {:hex, :ex_doc, "0.37.2", "2a3aa7014094f0e4e286a82aa5194a34dd17057160988b8509b15aa6c292720c", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "4dfa56075ce4887e4e8b1dcc121cd5fcb0f02b00391fd367ff5336d98fa49049"},
10+
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
11+
"makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
12+
"makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"},
13+
"nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
14+
"postgrex": {:hex, :postgrex, "0.20.0", "363ed03ab4757f6bc47942eff7720640795eb557e1935951c1626f0d303a3aed", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "d36ef8b36f323d29505314f704e21a1a038e2dc387c6409ee0cd24144e187c0f"},
15+
"scrivener": {:hex, :scrivener, "2.7.2", "1d913c965ec352650a7f864ad7fd8d80462f76a32f33d57d1e48bc5e9d40aba2", [:mix], [], "hexpm", "7866a0ec4d40274efbee1db8bead13a995ea4926ecd8203345af8f90d2b620d9"},
16+
"scrivener_ecto": {:hex, :scrivener_ecto, "3.1.0", "6e0fcfcabd289b1afe2f2be93db363030716c84ec0ff91fad9054fc6465bd2ee", [:mix], [{:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:scrivener, "~> 2.4", [hex: :scrivener, repo: "hexpm", optional: false]}], "hexpm", "86b721669c2718e8569bcc2573650ad749d5eada5f5bee41c9e260e7201fddf6"},
17+
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
1718
}

0 commit comments

Comments
 (0)