Skip to content

Instantly share code, notes, and snippets.

@Kr00lIX
Last active July 12, 2016 05:13
Show Gist options
  • Save Kr00lIX/bf5e7fab1536dfd96acb651c9b69ca13 to your computer and use it in GitHub Desktop.
Save Kr00lIX/bf5e7fab1536dfd96acb651c9b69ca13 to your computer and use it in GitHub Desktop.
CircleCI building Elixir Phoenix project with phantomjs
# add mix.exs deps
# {:junit_formatter, "~> 1.1.0", only: :test},
#
# .tool-versions file with content
# erlang 18.3
# elixir 1.3.0
# nodejs 5.5.0
#
machine:
node:
version: 5.1.0
environment:
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
MIX_ENV: "test"
post:
- phantomjs --wd :
background: true
dependencies:
cache_directories:
- ~/.asdf
- deps
- _build
pre:
- if [ ! -f /usr/local/bin/phantomjs ]; then sudo curl --output /usr/local/bin/phantomjs https://s3.amazonaws.com/circle-downloads/phantomjs-2.1.1; fi
- if ! asdf | grep version; then git clone https://github.com/HashNuke/asdf.git ~/.asdf; fi
- if ! asdf plugin-list | grep erlang; then asdf plugin-add erlang https://github.com/HashNuke/asdf-erlang.git; fi
- if ! asdf plugin-list | grep elixir; then asdf plugin-add elixir https://github.com/HashNuke/asdf-elixir.git; fi
- erlang_version=$(awk '/erlang/ { print $2 }' .tool-versions) && asdf install erlang ${erlang_version}
- elixir_version=$(awk '/elixir/ { print $2 }' .tool-versions) && asdf install elixir ${elixir_version}
- mix local.hex --force
- mix local.rebar --force
- mix deps.get --only test
- mix deps.compile
test:
override:
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
- mix test
- cp _build/test/lib/*/junit.xml $CIRCLE_TEST_REPORTS/junit/;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment