Skip to content

Commit 9041ead

Browse files
committed
Add simple GitHub Actions prototype
1 parent 5726fc9 commit 9041ead

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM elixir:alpine
2+
3+
ENTRYPOINT [ "elixir", "action.exs" ]

action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Elixir Script
2+
author: Jon Lauridsen
3+
description: Run simple Elixir scripts
4+
branding:
5+
color: orange
6+
icon: code
7+
inputs:
8+
script:
9+
description: The script to run
10+
required: true
11+
debug:
12+
description: Whether to tell the GitHub client to log details of its requests. true or false. Default is to run in debug mode when the GitHub Actions step debug logging is turned on.
13+
default: ${{ runner.debug == '1' }}
14+
outputs:
15+
result:
16+
description: The return value of the script, stringified with `JSON.stringify`
17+
runs:
18+
using: docker
19+
image: Dockerfile

lib/CLI.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
defmodule ElixirScript.CLI do
2+
def main(args \\ []) do
3+
IO.puts "ElixirScript.CLI 👋"
4+
IO.inspect args
5+
end
6+
end

mix.exs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ defmodule ElixirScript.MixProject do
66
app: :elixir_script,
77
version: "0.1.0",
88
elixir: "~> 1.15",
9-
start_permanent: Mix.env() == :prod,
9+
escript: escript(),
1010
deps: deps()
1111
]
1212
end
1313

14-
# Run "mix help compile.app" to learn about applications.
15-
def application do
14+
def escript do
1615
[
17-
extra_applications: [:logger]
16+
main_module: ElixirScript.CLI
1817
]
1918
end
2019

0 commit comments

Comments
 (0)