Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move from CircleCI to Github Actions #264

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .circleci/config.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on: push

env:
ELIXIR_ERL_OPTIONS: -kernel prevent_overlapping_partitions false

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
elixir-version: [1.15, 1.14, 1.13]
otp-version: [26, 25, 24]
exclude:
- elixir-version: 1.13
otp-version: 26

name: Tests
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir-version }}
otp-version: ${{ matrix.otp-version }}

- run: mix deps.get

- run: mix compile --warnings-as-errors
if: matrix.elixir-version == 1.15 && matrix.otp-version == 26

- run: mix format --check-formatted
if: matrix.elixir-version == 1.15 && matrix.otp-version == 26

- run: mix test
3 changes: 2 additions & 1 deletion lib/horde/processes_supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,8 @@ defmodule Horde.ProcessesSupervisor do
end

def handle_info(msg, state) do
:error_logger.error_msg('Horde.ProcessesSupervisor received unexpected message: ~p~n', [msg])
:error_logger.error_msg(~c"Horde.ProcessesSupervisor received unexpected message: ~p~n", [msg])

{:noreply, state}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/horde/supervisor_telemetry_poller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule Horde.DynamicSupervisorTelemetryPoller do
})
catch
:exit, reason ->
Logger.warn("""
Logger.warning("""
Exit while fetching metrics from #{inspect(supervisor_impl_name)}.
Skip poll action. Reason: #{inspect(reason)}.
""")
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defmodule Horde.MixProject do
{:stream_data, "~> 0.4", only: :test},
{:local_cluster, "~> 1.1", only: :test},
{:schism, "~> 1.0.1", only: :test},
{:dialyxir, "~> 1.0.0-rc.6", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0.0-rc.6", only: [:dev], runtime: false},
{:test_app, path: "test_app", only: [:test]}
]
end
Expand Down
2 changes: 1 addition & 1 deletion test/local_cluster_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
pid when is_pid(pid) ->
pid

x ->

Check warning on line 85 in test/local_cluster_test.exs

View workflow job for this annotation

GitHub Actions / Tests (1.13, 25)

variable "x" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 85 in test/local_cluster_test.exs

View workflow job for this annotation

GitHub Actions / Tests (1.14, 24)

variable "x" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 85 in test/local_cluster_test.exs

View workflow job for this annotation

GitHub Actions / Tests (1.14, 25)

variable "x" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 85 in test/local_cluster_test.exs

View workflow job for this annotation

GitHub Actions / Tests (1.14, 26)

variable "x" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 85 in test/local_cluster_test.exs

View workflow job for this annotation

GitHub Actions / Tests (1.13, 24)

variable "x" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 85 in test/local_cluster_test.exs

View workflow job for this annotation

GitHub Actions / Tests (1.15, 24)

variable "x" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 85 in test/local_cluster_test.exs

View workflow job for this annotation

GitHub Actions / Tests (1.15, 26)

variable "x" is unused (if the variable is not meant to be used, prefix it with an underscore)
Process.sleep(200)
do_await_replication(target, id)
end
Expand All @@ -101,7 +101,7 @@
nodes = rpc(target, Node, :list, [])

Logger.info(
"found #{inspect(pid)} on node: #{inspect(node(pid))}, target #{inspect(node)}, nodes: #{inspect(nodes)}"
"found #{inspect(pid)} on node: #{inspect(node(pid))}, target #{inspect(node())}, nodes: #{inspect(nodes)}"
)

Process.sleep(200)
Expand Down
10 changes: 5 additions & 5 deletions test/network_partition_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule NetworkPartitionTest do
use ExUnit.Case

setup do
nodes = LocalCluster.start_nodes("cluster-#{:rand.uniform(9_999_999)}", 2)
nodes = LocalCluster.start_nodes("cluster#{:erlang.unique_integer()}", 2)

for n <- nodes do
:rpc.call(n, Application, :ensure_all_started, [:test_app])
Expand All @@ -12,13 +12,13 @@ defmodule NetworkPartitionTest do
end

test "recovers as expected in case of network partition", %{nodes: [n1, n2] = nodes} do
assert {:ok, pid1} =
assert {:ok, _pid1} =
Horde.DynamicSupervisor.start_child(
{TestSup, n1},
{IgnoreWorker, {:via, Horde.Registry, {TestReg, IgnoreWorker}}}
)

assert {:ok, pid2} =
assert {:ok, _pid2} =
Horde.DynamicSupervisor.start_child(
{TestSup, n2},
{IgnoreWorker, {:via, Horde.Registry, {TestReg, IgnoreWorker}}}
Expand Down Expand Up @@ -48,13 +48,13 @@ defmodule NetworkPartitionTest do
end

test "recovers as expected in case of node stopping", %{nodes: [n1, n2] = nodes} do
assert {:ok, pid1} =
assert {:ok, _pid1} =
Horde.DynamicSupervisor.start_child(
{TestSup, n1},
{IgnoreWorker, {:via, Horde.Registry, {TestReg, IgnoreWorker}}}
)

assert {:ok, pid2} =
assert {:ok, _pid2} =
Horde.DynamicSupervisor.start_child(
{TestSup, n2},
{IgnoreWorker, {:via, Horde.Registry, {TestReg, IgnoreWorker}}}
Expand Down
Loading