This repository has been archived by the owner on Oct 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #478 from kazk/feature/erlang-otp20
Add Erlang support
- Loading branch information
Showing
16 changed files
with
909 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ env: | |
- TEST_IMG=nim | ||
- TEST_IMG=r | ||
- TEST_IMG=erlang | ||
- TEST_IMG=elixir | ||
|
||
script: | ||
- eslint '**/*.js' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM codewars/base-runner | ||
|
||
# Set the locale | ||
RUN locale-gen en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
RUN cd /tmp \ | ||
&& wget -q https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb \ | ||
&& dpkg -i erlang-solutions_1.0_all.deb \ | ||
&& rm erlang-solutions_1.0_all.deb \ | ||
&& apt-get update -q \ | ||
# && apt-cache showpkg esl-erlang \ | ||
# && apt-cache showpkg elixir \ | ||
&& apt-get install -q -y --no-install-recommends 'esl-erlang=1:18.3' 'elixir=1.2.4-*' | ||
|
||
# Install local Elixir hex and rebar | ||
RUN mix local.hex --force \ | ||
&& mix local.rebar --force | ||
|
||
RUN ln -s /home/codewarrior /workspace | ||
ENV NPM_CONFIG_LOGLEVEL warn | ||
|
||
WORKDIR /runner | ||
COPY package.json package.json | ||
RUN npm install --production | ||
|
||
COPY *.js ./ | ||
COPY lib/*.js lib/ | ||
COPY lib/*.sh lib/ | ||
COPY lib/utils lib/utils | ||
COPY lib/runners/elixir.js lib/runners/ | ||
COPY examples/elixir.yml examples/ | ||
COPY frameworks/elixir frameworks/elixir | ||
COPY test/runner.js test/ | ||
COPY test/runners/elixir_spec.js test/runners/ | ||
|
||
USER codewarrior | ||
ENV USER=codewarrior HOME=/home/codewarrior | ||
|
||
RUN mocha -t 5000 test/runners/elixir_spec.js | ||
|
||
ENTRYPOINT ["node"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Environment | ||
|
||
Code is executed within a Dockerized Ubuntu 14.04 container. | ||
|
||
## Language | ||
|
||
[Erlang/OTP 20.0](http://www.erlang.org/news/114) | ||
|
||
## Packages | ||
|
||
## Testing | ||
|
||
[EUnit](http://erlang.org/doc/apps/eunit/chapter.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
eunit: | ||
algorithms: | ||
initial: |- | ||
-module(algo). | ||
-export([two_oldest_ages/1]). | ||
two_oldest_ages(List) -> | ||
[0, 0]. | ||
answer: |- | ||
-module(algo). | ||
-export([two_oldest_ages/1]). | ||
two_oldest_ages(List) -> | ||
lists:nthtail(length(List)-2, lists:sort(List)). | ||
fixture: | ||
-module(algo_tests). | ||
-include_lib("eunit/include/eunit.hrl"). | ||
|
||
two_oldest_ages_test_() -> | ||
{"Two Oldest Ages", | ||
[{"returns [45, 87] for [1,5,87,45,8,8]", ?_assertMatch([45, 87], algo:two_oldest_ages([1,5,87,45,8,8]))}, | ||
{"returns [18, 83] for [6,5,83,5,3,18]", ?_assertMatch([18, 83], algo:two_oldest_ages([6,5,83,5,3,18]))}]}. |
10 changes: 10 additions & 0 deletions
10
frameworks/erlang/cw/_checkouts/eunit_codewars/rebar.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{erl_opts, []}. | ||
{deps, []}. | ||
|
||
{eunit_opts, [ | ||
no_tty, | ||
{report, {eunit_codewars, []}} | ||
]}. | ||
{eunit_compile_opts, [ | ||
nowarn_missing_spec | ||
]}. |
14 changes: 14 additions & 0 deletions
14
frameworks/erlang/cw/_checkouts/eunit_codewars/src/eunit_codewars.app.src
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{application, eunit_codewars, | ||
[{description, "EUnit reporter for Codewars"}, | ||
{vsn, "0.1.0"}, | ||
{registered, []}, | ||
{applications, | ||
[kernel, | ||
stdlib | ||
]}, | ||
{env,[]}, | ||
{modules, []}, | ||
{maintainers, []}, | ||
{licenses, ["Apache 2.0"]}, | ||
{links, []} | ||
]}. |
Oops, something went wrong.