Skip to content

Commit 0850850

Browse files
Add config for SemaphoreCI
1 parent 2de4eba commit 0850850

File tree

6 files changed

+49
-20
lines changed

6 files changed

+49
-20
lines changed

.semaphore/semaphore.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: "v1.0"
2+
name: "CI Build"
3+
4+
agent:
5+
machine:
6+
type: e1-standard-2
7+
os_image: ubuntu1804
8+
9+
auto_cancel:
10+
running:
11+
when: "true"
12+
13+
fail_fast:
14+
stop:
15+
when: "true"
16+
17+
blocks:
18+
- name: "Build"
19+
dependencies: []
20+
task:
21+
env_vars:
22+
- name: MIX_ENV
23+
value: test
24+
- name: DATABASE_URL
25+
value: postgresql://postgres@localhost/test?encoding=utf8
26+
secrets:
27+
- name: elasticsearch-elixir-coveralls
28+
jobs:
29+
- name: "Build"
30+
matrix:
31+
- env_var: ELIXIR_VERSION
32+
values: ["1.11.3"]
33+
- env_var: ELASTICSEARCH_VERSION
34+
values: ["6.8.13"]
35+
commands:
36+
- sem-version elixir $ELIXIR_VERSION
37+
- sem-service start postgres
38+
- sem-service start elasticsearch $ELASTICSEARCH_VERSION
39+
- checkout
40+
- cache restore
41+
- mix local.hex --force
42+
- mix local.rebar --force
43+
- mix deps.get
44+
- bin/test
45+
- cache store

bin/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ MIX_ENV=test mix compile --warnings-as-errors --force || { echo 'Please fix all
1010
MIX_ENV=test mix docs || { echo 'Elixir HTML docs were not generated!'; exit 1; }
1111

1212
if [ $CI ]; then
13-
mix coveralls.travis || { echo 'Elixir tests failed!'; exit 1; }
13+
mix coveralls.semaphore || { echo 'Elixir tests failed!'; exit 1; }
1414
else
1515
mix test || { echo 'Elixir tests failed!'; exit 1; }
1616
fi

config/config.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ config :elasticsearch, Elasticsearch.Test.Repo,
77
username: "postgres",
88
password: "",
99
database: "elasticsearch_test",
10-
hostname: "db",
10+
hostname: System.get_env("DATABASE_HOST", "localhost"),
1111
pool: Ecto.Adapters.SQL.Sandbox,
1212
priv: "test/support/"
1313

config/travis.exs

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

lib/elasticsearch/indexing/bulk.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ defmodule Elasticsearch.Index.Bulk do
4949
\"\"\"
5050
5151
iex> Bulk.encode!(Cluster, 123, "my-index")
52-
** (Protocol.UndefinedError) protocol Elasticsearch.Document not implemented for 123 of type Integer. This protocol is implemented for the following type(s): Post, Comment
52+
** (Protocol.UndefinedError) protocol Elasticsearch.Document not implemented for 123 of type Integer
5353
"""
5454
def encode!(cluster, struct, index) do
5555
config = Cluster.Config.get(cluster)

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule Elasticsearch.Mixfile do
1616
"coveralls.detail": :test,
1717
"coveralls.post": :test,
1818
"coveralls.html": :test,
19-
"coveralls.travis": :test
19+
"coveralls.semaphore": :test
2020
],
2121
docs: docs(),
2222
deps: deps(),

0 commit comments

Comments
 (0)