Skip to content

Commit

Permalink
Add config for SemaphoreCI
Browse files Browse the repository at this point in the history
  • Loading branch information
danielberkompas committed Jan 16, 2021
1 parent 2de4eba commit f4af2cb
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 20 deletions.
43 changes: 43 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: "v1.0"
name: "CI Build"

agent:
machine:
type: e1-standard-2
os_image: ubuntu1804

auto_cancel:
running:
when: "true"

fail_fast:
stop:
when: "true"

blocks:
- name: "Build"
dependencies: []
task:
env_vars:
- name: MIX_ENV
value: test
- name: DATABASE_URL
value: postgresql://postgres@localhost/test?encoding=utf8
jobs:
- name: "Build"
matrix:
- env_var: ELIXIR_VERSION
values: ["1.11.3"]
- env_var: ELASTICSEARCH_VERSION
values: ["6.8.13"]
commands:
- sem-version elixir $ELIXIR_VERSION
- sem-service start postgres
- sem-service start elasticsearch $ELASTICSEARCH_VERSION
- checkout
- cache restore
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- bin/test
- cache store
2 changes: 1 addition & 1 deletion bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MIX_ENV=test mix compile --warnings-as-errors --force || { echo 'Please fix all
MIX_ENV=test mix docs || { echo 'Elixir HTML docs were not generated!'; exit 1; }

if [ $CI ]; then
mix coveralls.travis || { echo 'Elixir tests failed!'; exit 1; }
mix coveralls.semaphore || { echo 'Elixir tests failed!'; exit 1; }
else
mix test || { echo 'Elixir tests failed!'; exit 1; }
fi
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ config :elasticsearch, Elasticsearch.Test.Repo,
username: "postgres",
password: "",
database: "elasticsearch_test",
hostname: "db",
hostname: System.get_env("DATABASE_HOST", "localhost"),
pool: Ecto.Adapters.SQL.Sandbox,
priv: "test/support/"

Expand Down
16 changes: 0 additions & 16 deletions config/travis.exs

This file was deleted.

2 changes: 1 addition & 1 deletion lib/elasticsearch/indexing/bulk.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ defmodule Elasticsearch.Index.Bulk do
\"\"\"
iex> Bulk.encode!(Cluster, 123, "my-index")
** (Protocol.UndefinedError) protocol Elasticsearch.Document not implemented for 123 of type Integer. This protocol is implemented for the following type(s): Post, Comment
** (Protocol.UndefinedError) protocol Elasticsearch.Document not implemented for 123 of type Integer
"""
def encode!(cluster, struct, index) do
config = Cluster.Config.get(cluster)
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule Elasticsearch.Mixfile do
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test,
"coveralls.travis": :test
"coveralls.semaphore": :test
],
docs: docs(),
deps: deps(),
Expand Down

0 comments on commit f4af2cb

Please sign in to comment.