Skip to content

Commit

Permalink
Add minimal elixir 1.15.8 project + CircleCI config
Browse files Browse the repository at this point in the history
  • Loading branch information
lwld committed Jul 12, 2024
1 parent 9814c45 commit 9e6f6b7
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 7 deletions.
31 changes: 31 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2.1

workflows:
check:
jobs:
- compile

jobs:
compile:
docker:
- image: cimg/elixir:1.15.8-erlang-26.2.1
steps:
- checkout
- run:
name: "Check elixir version"
command: elixir --version
- run:
name: "Install hex"
command: mix local.hex --force
- run:
name: "Install rebar"
command: mix local.rebar --force
- run:
name: "Get elixir dependencies"
command: mix deps.get
- run:
name: "Build elixir"
command: mix compile --warnings-as-errors
- run:
name: "Run elixir tests"
command: mix test
4 changes: 4 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Used by "mix format"
[
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
30 changes: 23 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
/_build
/cover
/deps
/doc
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where third-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez
*.beam
/config/*.secret.exs
.elixir_ls/

# Ignore package tarball (built via "mix hex.build").
cimg_test-*.tar

# Temporary files, for example, from tests.
/tmp/
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
erlang 26.2.1
elixir 1.15.8-otp-26
18 changes: 18 additions & 0 deletions lib/cimg_test.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
defmodule CimgTest do
@moduledoc """
Documentation for `CimgTest`.
"""

@doc """
Hello world.
## Examples
iex> CimgTest.hello()
:world
"""
def hello do
:world
end
end
28 changes: 28 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
defmodule CimgTest.MixProject do
use Mix.Project

def project do
[
app: :cimg_test,
version: "0.1.0",
elixir: "~> 1.15.8",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end

# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end

# Run "mix help deps" to learn about dependencies.
defp deps do
[
# {:dep_from_hexpm, "~> 0.3.0"},
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
]
end
end
8 changes: 8 additions & 0 deletions test/cimg_test_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
defmodule CimgTestTest do
use ExUnit.Case
doctest CimgTest

test "greets the world" do
assert CimgTest.hello() == :world
end
end
1 change: 1 addition & 0 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ExUnit.start()

0 comments on commit 9e6f6b7

Please sign in to comment.