Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Ajout CircleCI #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
55 changes: 55 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: 2
jobs:
build:
parallelism: 1
docker:
- image: circleci/elixir:1.10.2
environment:
MIX_ENV: test

working_directory: ~/app

steps:
- checkout

- run: mix local.hex --force

- run: mix local.rebar --force

- restore_cache:
keys:
- v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
- v1-mix-cache-{{ .Branch }}
- v1-mix-cache

- restore_cache:
keys:
- v1-build-cache-{{ .Branch }}
- v1-build-cache

- run: mix do deps.get, compile

- save_cache:
key: v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
paths: "deps"

- save_cache:
key: v1-mix-cache-{{ .Branch }}
paths: "deps"

- save_cache:
key: v1-mix-cache
paths: "deps"

- save_cache:
key: v1-build-cache-{{ .Branch }}
paths: "_build"

- save_cache:
key: v1-build-cache
paths: "_build"

- run: mix test

- store_test_results:
path: _build/test/lib/covid19_orientation
2 changes: 1 addition & 1 deletion lib/covid19_orientation/test_orientation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ defmodule Covid19Orientation.TestOrientation do
}
}
) do
fievre(orientation) || (toux && mal_de_gorge) || (toux && anosmie) ||
(fievre(orientation) && !toux) || (toux && mal_de_gorge) || (toux && anosmie) ||
(fievre(orientation) && diarrhee)
end

Expand Down
4 changes: 2 additions & 2 deletions lib/covid19_orientation/tree_traversal.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ defmodule Covid19Orientation.TreeTraversal do
result = tree.operation.(value)

cond do
prev_depth < depth && not prev_result -> traverse(stack, value, {prev_depth, prev_result})
prev_depth < depth && !prev_result -> traverse(stack, value, {prev_depth, prev_result})
tree.type != :leaf -> traverse(stack, value, {depth, result})
not result -> traverse(stack, value, {depth, result})
!result -> traverse(stack, value, {depth, result})
true -> {:ok, tree}
end
end
Expand Down