Commit 029c2933 authored by Frank Kumro's avatar Frank Kumro

Try adding phoenix to the CI pipeline

parent e5adf108
Pipeline #51753384 failed
......@@ -5,23 +5,24 @@ variables:
MIX_TARGET: "host"
HEX_HOME: "$CI_PROJECT_DIR/.hex"
MIX_HOME: "$CI_PROJECT_DIR/.mix"
NERVES_ENV_DISABLED: 1
stages:
- prepare_firmware_deps
- test_firmware
- prepare_nerves_deps
- test_nerves
- prepare_nerves_deps
- test_phoenix
- deploy
prepare_firmware_deps:
prepare_nerves_deps:
stage: prepare_firmware_deps
cache:
key: '$CI_COMMIT_REF_SLUG-firmware'
key: $CI_COMMIT_REF_SLUG
paths:
- "$CI_PROJECT_DIR/fw/deps/"
- "$CI_PROJECT_DIR/fw/_build/"
- "$CI_PROJECT_DIR/.hex/"
- "$CI_PROJECT_DIR/.mix/"
script:
- cd /srv/ && mix local.hex --force
- mix local.rebar --force
......@@ -29,10 +30,25 @@ prepare_firmware_deps:
- mix local.nerves --force
- 'cd $CI_PROJECT_DIR/fw && mix deps.get --only test'
compile_with_warnings_as_errors:
stage: test_firmware
prepare_phoenix_deps:
stage: test_nerves
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- "$CI_PROJECT_DIR/ui/deps/"
- "$CI_PROJECT_DIR/ui/_build/"
- "$CI_PROJECT_DIR/.hex/"
- "$CI_PROJECT_DIR/.mix/"
script:
- cd /srv/ && mix local.hex --force
- mix local.rebar --force
- mix archive.install hex phx_new 1.4.1
- 'cd $CI_PROJECT_DIR/ui && mix deps.get --only test'
compile_with_warnings_as_errors_nerves:
stage: test_nerves
cache:
key: '$CI_COMMIT_REF_SLUG-firmware'
key: $CI_COMMIT_REF_SLUG
paths:
- "$CI_PROJECT_DIR/fw/deps/"
- "$CI_PROJECT_DIR/fw/_build/"
......@@ -42,10 +58,10 @@ compile_with_warnings_as_errors:
script:
- 'cd $CI_PROJECT_DIR/fw && mix compile --warnings-as-errors'
unit_testing:
stage: test_firmware
unit_testing_nerves:
stage: test_nerves
cache:
key: '$CI_COMMIT_REF_SLUG-firmware'
key: $CI_COMMIT_REF_SLUG
paths:
- "$CI_PROJECT_DIR/fw/deps/"
- "$CI_PROJECT_DIR/fw/_build/"
......@@ -55,10 +71,10 @@ unit_testing:
script:
- 'cd $CI_PROJECT_DIR/fw && mix test'
dialyzer:
stage: test_firmware
dialyzer_nerves:
stage: test_nerves
cache:
key: '$CI_COMMIT_REF_SLUG-firmware'
key: $CI_COMMIT_REF_SLUG
paths:
- "$CI_PROJECT_DIR/fw/deps/"
- "$CI_PROJECT_DIR/fw/_build/"
......@@ -68,10 +84,10 @@ dialyzer:
script:
- 'cd $CI_PROJECT_DIR/fw && mix dialyzer --format long --halt-exit-status'
credo:
stage: test_firmware
credo_nerves:
stage: test_nerves
cache:
key: '$CI_COMMIT_REF_SLUG-firmware'
key: $CI_COMMIT_REF_SLUG
paths:
- "$CI_PROJECT_DIR/fw/deps/"
- "$CI_PROJECT_DIR/fw/_build/"
......@@ -81,13 +97,65 @@ credo:
script:
- 'cd $CI_PROJECT_DIR/fw && mix credo'
compile_with_warnings_as_errors_phoenix:
stage: test_phoenix
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- "$CI_PROJECT_DIR/ui/deps/"
- "$CI_PROJECT_DIR/ui/_build/"
- "$CI_PROJECT_DIR/.hex/"
- "$CI_PROJECT_DIR/.mix/"
policy: pull
script:
- 'cd $CI_PROJECT_DIR/ui && mix compile --warnings-as-errors'
unit_testing_phoenix:
stage: test_phoenix
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- "$CI_PROJECT_DIR/ui/deps/"
- "$CI_PROJECT_DIR/ui/_build/"
- "$CI_PROJECT_DIR/.hex/"
- "$CI_PROJECT_DIR/.mix/"
policy: pull
script:
- 'cd $CI_PROJECT_DIR/ui && mix test'
dialyzer_phoenix:
stage: test_phoenix
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- "$CI_PROJECT_DIR/ui/deps/"
- "$CI_PROJECT_DIR/ui/_build/"
- "$CI_PROJECT_DIR/.hex/"
- "$CI_PROJECT_DIR/.mix/"
policy: pull
script:
- 'cd $CI_PROJECT_DIR/ui && mix dialyzer --format long --halt-exit-status'
credo_phoenix:
stage: test_phoenix
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- "$CI_PROJECT_DIR/ui/deps/"
- "$CI_PROJECT_DIR/ui/_build/"
- "$CI_PROJECT_DIR/.hex/"
- "$CI_PROJECT_DIR/.mix/"
policy: pull
script:
- 'cd $CI_PROJECT_DIR/ui && mix credo'
pages:
stage: deploy
script:
- 'cd $CI_PROJECT_DIR/fw'
- mkdir public
- MIX_ENV=dev mix deps.get
- NERVES_ENV_DISABLED=1 MIX_ENV=dev mix docs
- MIX_ENV=dev mix docs
- cp -r doc/* public
- rm -rf doc
artifacts:
......
erlang 21.2.4
erlang 21.2.7
elixir 1.8.1-otp-21
nodejs 10.14.1
\ No newline at end of file
defmodule UiWeb.Channels.WeatherRoomChannel do
@moduledoc false
use Phoenix.Channel
@impl true
......
......@@ -5,7 +5,7 @@ defmodule Ui.MixProject do
[
app: :ui,
version: "0.1.0",
elixir: "~> 1.5",
elixir: "~> 1.8",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
......@@ -32,13 +32,15 @@ defmodule Ui.MixProject do
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.4.0"},
{:phoenix, "~> 1.4"},
{:phoenix_pubsub, "~> 1.1"},
{:phoenix_html, "~> 2.12"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:gettext, "~> 0.11"},
{:jason, "~> 1.1"},
{:plug_cowboy, "~> 2.0"}
{:plug_cowboy, "~> 2.0"},
{:dialyxir, "~> 1.0.0-rc.4", only: [:dev, :test], runtime: false},
{:credo, "~> 1.0", only: [:dev, :test], runtime: false}
]
end
end
%{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"},
"cowboy": {:hex, :cowboy, "2.5.0", "4ef3ae066ee10fe01ea3272edc8f024347a0d3eb95f6fbb9aed556dacbfc1337", [:rebar3], [{:cowlib, "~> 2.6.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.6.2", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"},
"cowlib": {:hex, :cowlib, "2.6.0", "8aa629f81a0fc189f261dc98a42243fa842625feea3c7ec56c48f4ccdb55490f", [:rebar3], [], "hexpm"},
"credo": {:hex, :credo, "1.0.3", "5278e8953f379b41ebe27c75c96d2e154ebc3f75dfe057c8b68c39133c25bb9f", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"dialyxir": {:hex, :dialyxir, "1.0.0-rc.4", "71b42f5ee1b7628f3e3a6565f4617dfb02d127a0499ab3e72750455e986df001", [:mix], [{:erlex, "~> 0.1", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm"},
"erlex": {:hex, :erlex, "0.2.1", "cee02918660807cbba9a7229cae9b42d1c6143b768c781fa6cee1eaf03ad860b", [:mix], [], "hexpm"},
"file_system": {:hex, :file_system, "0.2.6", "fd4dc3af89b9ab1dc8ccbcc214a0e60c41f34be251d9307920748a14bf41f1d3", [:mix], [], "hexpm"},
"gettext": {:hex, :gettext, "0.16.0", "4a7e90408cef5f1bf57c5a39e2db8c372a906031cc9b1466e963101cb927dafc", [:mix], [], "hexpm"},
"jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"},
......
defmodule UiWeb.PageControllerTest do
use UiWeb.ConnCase
test "GET /", %{conn: conn} do
conn = get(conn, "/")
assert html_response(conn, 200) =~ "Welcome to Phoenix!"
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment