Skip to content

Commit

Permalink
create ci
Browse files Browse the repository at this point in the history
  • Loading branch information
rudebono committed May 14, 2024
1 parent a3fa49a commit a2759c9
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 2 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
push:
branches: ["**"]
workflow_dispatch:
inputs:

jobs:
check:
runs-on: ubuntu-latest
env:
MIX_ENV: test
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Erlang OTP/Elixir
uses: erlef/setup-beam@v1
with:
otp-version: 26.2.5
elixir-version: 1.16.2-otp-26

- name: Cache dependencies restore
id: cache-dependencies-restore
uses: actions/cache/restore@v4
with:
path: |
_build
deps
key: test-deps-${{ hashFiles('mix.lock') }}

- name: Install dependencies
if: steps.cache-dependencies-restore.outputs.cache-hit != 'true'
run: |
mix deps.get
mix deps.compile
- name: Cache dependencies save
if: steps.cache-dependencies-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
_build
deps
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }}

- name: Compile
run: mix compile --all-warnings --warnings-as-errors

- name: Check format
run: mix format --check-formatted

- name: Check credo
run: mix credo --all

- name: Cache plt restore
id: cache-plt-restore
uses: actions/cache/restore@v4
with:
path: |
_build/*/*.plt
_build/*/*.plt.hash
key: test-plt-${{ hashFiles('mix.lock') }}

- name: Create plt
if: steps.cache-plt-restore.outputs.cache-hit != 'true'
run: mix dialyzer --plt

- name: Cache plt save
if: steps.cache-plt-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
_build/*/*.plt
_build/*/*.plt.hash
key: ${{ steps.cache-plt-restore.outputs.cache-primary-key }}

- name: Check dialyzer
run: mix dialyzer --format github

- name: Check test
run: mix test --all-warnings --warnings-as-errors
1 change: 1 addition & 0 deletions lib/absinthe_one_of.ex
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
defmodule AbsintheOneOf do
@moduledoc false
end
2 changes: 2 additions & 0 deletions lib/directive.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
defmodule AbsintheOneOf.Directive do
@moduledoc false

use Absinthe.Schema.Prototype

directive :one_of do
Expand Down
2 changes: 2 additions & 0 deletions lib/phase.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
defmodule AbsintheOneOf.Phase do
@moduledoc false

@behaviour Absinthe.Phase

@impl true
Expand Down
6 changes: 4 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ defmodule AbsintheOneOf.MixProject do
defp deps() do
[
{:absinthe, "~> 1.7"},
{:absinthe_phoenix, "~> 2.0", only: :test},
{:jason, "~> 1.4", only: :test}
{:absinthe_phoenix, "~> 2.0", only: :test, runtime: false},
{:jason, "~> 1.4", only: :test},
{:dialyxir, "~> 1.4", only: :test, runtime: false},
{:credo, "~> 1.7", only: :test, runtime: false}
]
end
end
5 changes: 5 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
"absinthe": {:hex, :absinthe, "1.7.6", "0b897365f98d068cfcb4533c0200a8e58825a4aeeae6ec33633ebed6de11773b", [:mix], [{:dataloader, "~> 1.0.0 or ~> 2.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:opentelemetry_process_propagator, "~> 0.2.1", [hex: :opentelemetry_process_propagator, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e7626951ca5eec627da960615b51009f3a774765406ff02722b1d818f17e5778"},
"absinthe_phoenix": {:hex, :absinthe_phoenix, "2.0.3", "74e0862f280424b7bc290f6f69e133268bce0b4e7db0218c7e129c5c2b1d3fd4", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:absinthe_plug, "~> 1.5", [hex: :absinthe_plug, repo: "hexpm", optional: false]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.5", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.13 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}], "hexpm", "caffaea03c17ea7419fe07e4bc04c2399c47f0d8736900623dbf4749a826fd2c"},
"absinthe_plug": {:hex, :absinthe_plug, "1.5.8", "38d230641ba9dca8f72f1fed2dfc8abd53b3907d1996363da32434ab6ee5d6ab", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bbb04176647b735828861e7b2705465e53e2cf54ccf5a73ddd1ebd855f996e5a"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"},
"credo": {:hex, :credo, "1.7.6", "b8f14011a5443f2839b04def0b252300842ce7388f3af177157c86da18dfbeea", [: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", "146f347fb9f8cbc5f7e39e3f22f70acbef51d441baa6d10169dd604bfbc55296"},
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
Expand Down

0 comments on commit a2759c9

Please sign in to comment.