Set up CI.

This commit is contained in:
James Harton 2020-07-10 17:37:37 +12:00
parent ec70c01b5f
commit cdde38d288
5 changed files with 81 additions and 19 deletions

56
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,56 @@
image: elixir:latest
cache:
key: "$CI_JOB_NAME"
paths:
- deps
- _build
- /root/.mix
variables:
MIX_ENV: "test"
before_script:
- mix local.hex --force
- mix local.rebar --force
- mix deps.get --only test
test:
stage: test
script:
- mix test
credo:
stage: test
script:
- mix credo
audit:
stage: test
script:
- mix hex.audit
format:
stage: test
script:
- mix format --check-formatted
pages:
stage: deploy
script:
- mix docs -o public
artifacts:
paths:
- public
only:
- master
package:
stage: deploy
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
script:
- mix hex.build
artifacts:
paths:
- "wopr-*.tar"

View file

@ -2,17 +2,4 @@ defmodule WOPR do
@moduledoc """ @moduledoc """
Documentation for `WOPR`. Documentation for `WOPR`.
""" """
@doc """
Hello world.
## Examples
iex> WOPR.hello()
:world
"""
def hello do
:world
end
end end

16
mix.exs
View file

@ -7,6 +7,7 @@ defmodule WOPR.MixProject do
version: "0.1.0", version: "0.1.0",
elixir: "~> 1.10", elixir: "~> 1.10",
start_permanent: Mix.env() == :prod, start_permanent: Mix.env() == :prod,
package: package(),
deps: deps() deps: deps()
] ]
end end
@ -19,11 +20,22 @@ defmodule WOPR.MixProject do
] ]
end end
def package do
[
maintainers: ["James Harton <james@automat.nz>"],
licenses: ["Hippocratic"],
links: %{
"Source" => "https://gitlab.com/jimsy/wopr"
}
]
end
# Run "mix help deps" to learn about dependencies. # Run "mix help deps" to learn about dependencies.
defp deps do defp deps do
[ [
# {:dep_from_hexpm, "~> 0.3.0"}, {:credo, "~> 1.1", only: [:dev, :test], runtime: false},
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} {:earmark, ">= 0.0.0", only: [:dev, :test]},
{:ex_doc, ">= 0.0.0", only: [:dev, :test]}
] ]
end end
end end

11
mix.lock Normal file
View file

@ -0,0 +1,11 @@
%{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"credo": {:hex, :credo, "1.4.0", "92339d4cbadd1e88b5ee43d427b639b68a11071b6f73854e33638e30a0ea11f5", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1fd3b70dce216574ce3c18bdf510b57e7c4c85c2ec9cad4bff854abaf7e58658"},
"earmark": {:hex, :earmark, "1.4.9", "837e4c1c5302b3135e9955f2bbf52c6c52e950c383983942b68b03909356c0d9", [:mix], [{:earmark_parser, ">= 1.4.9", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "0d72df7d13a3dc8422882bed5263fdec5a773f56f7baeb02379361cb9e5b0d8e"},
"earmark_parser": {:hex, :earmark_parser, "1.4.9", "819bda2049e6ee1365424e4ced1ba65806eacf0d2867415f19f3f80047f8037b", [:mix], [], "hexpm", "8bf54fddabf2d7e137a0c22660e71b49d5a0a82d1fb05b5af62f2761cd6485c4"},
"ex_doc": {:hex, :ex_doc, "0.22.1", "9bb6d51508778193a4ea90fa16eac47f8b67934f33f8271d5e1edec2dc0eee4c", [:mix], [{:earmark, "~> 1.4.0", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "d957de1b75cb9f78d3ee17820733dc4460114d8b1e11f7ee4fd6546e69b1db60"},
"jason": {:hex, :jason, "1.2.1", "12b22825e22f468c02eb3e4b9985f3d0cb8dc40b9bd704730efa11abd2708c44", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "b659b8571deedf60f79c5a608e15414085fa141344e2716fbd6988a084b5f993"},
"makeup": {:hex, :makeup, "1.0.3", "e339e2f766d12e7260e6672dd4047405963c5ec99661abdc432e6ec67d29ef95", [:mix], [{:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "2e9b4996d11832947731f7608fed7ad2f9443011b3b479ae288011265cdd3dad"},
"makeup_elixir": {:hex, :makeup_elixir, "0.14.1", "4f0e96847c63c17841d42c08107405a005a2680eb9c7ccadfd757bd31dabccfb", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f2438b1a80eaec9ede832b5c41cd4f373b38fd7aa33e3b22d9db79e640cbde11"},
"nimble_parsec": {:hex, :nimble_parsec, "0.6.0", "32111b3bf39137144abd7ba1cce0914533b2d16ef35e8abc5ec8be6122944263", [:mix], [], "hexpm", "27eac315a94909d4dc68bc07a4a83e06c8379237c5ea528a9acff4ca1c873c52"},
}

View file

@ -1,8 +1,4 @@
defmodule WOPRTest do defmodule WOPRTest do
use ExUnit.Case use ExUnit.Case
doctest WOPR doctest WOPR
test "greets the world" do
assert WOPR.hello() == :world
end
end end