Skip to content

Commit baa8762

Browse files
committed
Initial version
0 parents  commit baa8762

14 files changed

Lines changed: 1032 additions & 0 deletions

File tree

.formatter.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Used by "mix format"
2+
[
3+
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
4+
]

.github/workflows/test.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
name: Test
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
jobs:
12+
test:
13+
name: Run tests
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
otp: ['24', '25', '26', '27', '28']
19+
elixir: ['1.14.5', '1.15.7', '1.16.3', '1.17.3', '1.18.4', '1.19.4']
20+
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html
21+
exclude:
22+
- otp: '24'
23+
elixir: '1.19.4'
24+
- otp: '24'
25+
elixir: '1.18.4'
26+
- otp: '24'
27+
elixir: '1.17.3'
28+
- otp: '25'
29+
elixir: '1.19.4'
30+
- otp: '26'
31+
elixir: '1.14.5'
32+
- otp: '27'
33+
elixir: '1.14.5'
34+
- otp: '27'
35+
elixir: '1.15.7'
36+
- otp: '27'
37+
elixir: '1.16.3'
38+
- otp: '28'
39+
elixir: '1.14.5'
40+
- otp: '28'
41+
elixir: '1.15.7'
42+
- otp: '28'
43+
elixir: '1.16.3'
44+
- otp: '28'
45+
elixir: '1.17.3'
46+
env:
47+
MIX_ENV: test
48+
steps:
49+
- name: Check out source
50+
uses: actions/checkout@v4
51+
52+
- name: Install Erlang and Elixir
53+
uses: erlef/setup-beam@v1
54+
with:
55+
otp-version: ${{ matrix.otp }}
56+
elixir-version: ${{ matrix.elixir }}
57+
58+
- name: Cache deps
59+
id: cache-deps
60+
uses: actions/cache@v4
61+
env:
62+
cache-name: cache-elixir-deps
63+
with:
64+
path: deps
65+
key: ${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
66+
restore-keys: |
67+
${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}-
68+
69+
- name: Cache compiled build
70+
id: cache-build
71+
uses: actions/cache@v4
72+
env:
73+
cache-name: cache-compiled-build
74+
with:
75+
path: _build
76+
key: ${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
77+
restore-keys: |
78+
${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}-
79+
80+
- name: Install tools
81+
run: mix do local.rebar --force, local.hex --force
82+
83+
- name: Get Elixir deps
84+
run: mix deps.get
85+
86+
- name: Compile
87+
run: mix compile --warnings-as-errors
88+
89+
# - name: Check formatting
90+
# run: mix format --check-formatted
91+
92+
- name: Run tests
93+
run: mix test
94+
95+
- name: Run credo
96+
run: mix credo --mute-exit-status
97+
# run: mix credo
98+
99+
- name: Run hex.audit
100+
run: mix hex.audit
101+
102+
- name: Run deps.audit
103+
run: mix deps.audit
104+
105+
- name: Run dialyzer
106+
run: mix dialyzer --ignore-exit-status --format github
107+
108+
- name: Publish unit test results to GitHub
109+
uses: EnricoMi/publish-unit-test-result-action@v2
110+
# Run even if tests fail
111+
if: always()
112+
with:
113+
junit_files: _build/test/junit-reports/*.xml
114+
# junit_files: _build/test/lib/*/*.xml
115+
check_name: "Test Results ${{matrix.elixir}} ${{matrix.otp}}"
116+
117+
# - name: Upload results to Datadog
118+
# if: always()
119+
# continue-on-error: true
120+
# env:
121+
# DD_API_KEY: ${{ secrets.ACTIONS_DD_API_KEY }}
122+
# DD_ENV: ci
123+
# run: |
124+
# npm install -g @datadog/datadog-ci
125+
# datadog-ci junit upload --service api-graphql _build/test/lib/*/test-junit-report.xml

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where third-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Temporary files, for example, from tests.
14+
/tmp/
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
libcluster_aws_ecs-*.tar
24+
25+
# Environment files
26+
.env
27+
.envrc
28+
29+
# macOS junk
30+
.DS_Store

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# LibclusterAwsEcs
2+
3+
**TODO: Add description**
4+
5+
## Installation
6+
7+
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
8+
by adding `libcluster_aws_ecs` to your list of dependencies in `mix.exs`:
9+
10+
```elixir
11+
def deps do
12+
[
13+
{:libcluster_aws_ecs, "~> 0.1.0"}
14+
]
15+
end
16+
```
17+
18+
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
19+
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
20+
be found at <https://hexdocs.pm/libcluster_aws_ecs>.
21+

config/config.exs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Config
2+
3+
config :logger, :default_formatter,
4+
format: "$time $metadata[$level] $message\n",
5+
metadata: [:pid, :module, :function, :line]
6+
7+
config :logger,
8+
level: :info
9+
10+
import_config "#{config_env()}.exs"

config/dev.exs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Config
2+
3+
config :logger, :default_formatter,
4+
format: "$time $metadata[$level] $message\n",
5+
metadata: [:file, :line]
6+
7+
config :logger,
8+
level: :debug
9+
10+
config :ex_aws,
11+
access_key_id: {:system, "AWS_ACCESS_KEY_ID"},
12+
security_token: {:system, "AWS_SESSION_TOKEN"},
13+
secret_access_key: {:system, "AWS_SECRET_ACCESS_KEY"}

config/prod.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import Config

config/test.exs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Config
2+
3+
config :junit_formatter,
4+
report_dir: "#{Mix.Project.build_path()}/junit-reports",
5+
automatic_create_dir?: true,
6+
print_report_file: true,
7+
# prepend_project_name?: true,
8+
include_filename?: true,
9+
include_file_line?: true
10+
11+
config :logger, :default_formatter,
12+
format: "$time $metadata[$level] $message\n",
13+
metadata: [:file, :line]
14+
15+
config :logger,
16+
level: :warning,
17+
always_evaluate_messages: true

0 commit comments

Comments
 (0)