Skip to content

Commit 5524fb4

Browse files
committed
add credo and ci
1 parent b2db365 commit 5524fb4

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

.github/workflows/ci.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
tests:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: erlef/setup-beam@v1
17+
with:
18+
otp-version: "27.0.1"
19+
elixir-version: "1.17.2"
20+
21+
- uses: actions/cache@v4
22+
id: cache-elixir-build-deps
23+
with:
24+
path: |
25+
_build
26+
deps
27+
key: ${{ runner.os }}-mix-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
28+
29+
- name: compile elixir deps
30+
if: steps.cache-elixir-build-deps.outputs.cache-hit != 'true'
31+
env:
32+
MIX_ENV: test
33+
run: mix do deps.get, deps.compile
34+
35+
- name: test
36+
run: mix test
37+
38+
- name: credo
39+
run: mix credo --strict
40+
41+
- name: dialyzer
42+
run: mix dialyzer
43+
44+
- name: check format
45+
run: mix format --check-formatted
46+

lib/web_push.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ defmodule WebPush do
5454
:ECPrivateKey,
5555
1,
5656
fetch_vapid!(:private_key),
57-
{:namedCurve, {1, 2, 840, 10045, 3, 1, 7}},
57+
{:namedCurve, {1, 2, 840, 10_045, 3, 1, 7}},
5858
fetch_vapid!(:public_key),
5959
nil
6060
})

mix.exs

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ defmodule WebPush.MixProject do
3939
# Run "mix help deps" to learn about dependencies.
4040
defp deps do
4141
[
42+
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
4243
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
4344
{:jose, "~> 1.11"}
4445
]

mix.lock

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
%{
2+
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
3+
"credo": {:hex, :credo, "1.7.7", "771445037228f763f9b2afd612b6aa2fd8e28432a95dbbc60d8e03ce71ba4446", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8bc87496c9aaacdc3f90f01b7b0582467b69b4bd2441fe8aae3109d843cc2f2e"},
24
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
35
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
6+
"file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"},
47
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
58
"jose": {:hex, :jose, "1.11.10", "a903f5227417bd2a08c8a00a0cbcc458118be84480955e8d251297a425723f83", [:mix, :rebar3], [], "hexpm", "0d6cd36ff8ba174db29148fc112b5842186b68a90ce9fc2b3ec3afe76593e614"},
69
}

0 commit comments

Comments
 (0)