Skip to content

Commit 696a3c3

Browse files
authored
Merge pull request #29 from membraneframework/migrate-to-github-actions
Migrate CI from CircleCI to GitHub Actions
2 parents bd3bba4 + 27f2dfb commit 696a3c3

7 files changed

Lines changed: 92 additions & 87 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build_test:
10+
uses: membraneframework/membrane_actions/.github/workflows/build-test.yml@setup-commands
11+
with:
12+
setup-commands: apt-get update && apt-get install -y libnice-dev
13+
14+
15+
lint:
16+
uses: membraneframework/membrane_actions/.github/workflows/lint.yml@setup-commands
17+
with:
18+
dialyzer: false
19+
setup-commands: apt-get update && apt-get install -y libnice-dev
20+
21+
test:
22+
uses: membraneframework/membrane_actions/.github/workflows/test.yml@setup-commands
23+
with:
24+
setup-commands: apt-get update && apt-get install -y libnice-dev

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The package can be installed by adding `ex_libnice` to your list of dependencies
2929
```elixir
3030
def deps do
3131
[
32-
{:ex_libnice, "~> 0.8.0"}
32+
{:ex_libnice, "~> 0.8.1"}
3333
]
3434
end
3535
```

bundlex.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule ExLibnice.BundlexProject do
1212
native: [
1313
sources: ["native.c", "parser.c"],
1414
deps: [unifex: :unifex],
15-
pkg_configs: ["nice"],
15+
os_deps: [nice: :pkg_config],
1616
interface: [:nif, :cnode],
1717
preprocessor: Unifex
1818
]

lib/ex_libnice.ex

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ defmodule ExLibnice do
272272
# Server API
273273
@impl true
274274
def init(opts) do
275-
min_port..max_port = opts[:port_range]
275+
min_port..max_port//_step = opts[:port_range]
276276

277277
{:ok, stun_servers} = lookup_stun_servers(opts[:stun_servers])
278278

@@ -298,7 +298,7 @@ defmodule ExLibnice do
298298
{:reply, {:ok, stream_id}, put_in(state.stream_components[stream_id], n_components)}
299299

300300
{{:error, cause}, state} ->
301-
Logger.warn("""
301+
Logger.warning("""
302302
Couldn't add stream with #{n_components} components and name "#{inspect(name)}": \
303303
#{inspect(cause)}
304304
""")
@@ -325,7 +325,7 @@ defmodule ExLibnice do
325325
{:reply, :ok, state}
326326

327327
{{:error, cause}, state} ->
328-
Logger.warn("""
328+
Logger.warning("""
329329
Couldn't forget TURN servers for component: #{inspect(component_id)} in stream: \
330330
#{inspect(stream_id)}, reason: #{inspect(cause)}
331331
""")
@@ -349,7 +349,7 @@ defmodule ExLibnice do
349349
{:reply, {:ok, added_cand_num}, state}
350350

351351
{{:error, cause}, state} ->
352-
Logger.warn("Couldn't parse remote sdp #{inspect(remote_sdp)}")
352+
Logger.warning("Couldn't parse remote sdp #{inspect(remote_sdp)}")
353353
{:reply, {:error, cause}, state}
354354
end
355355
end
@@ -409,7 +409,7 @@ defmodule ExLibnice do
409409
{:reply, :ok, state}
410410

411411
{{:error, cause}, state} ->
412-
Logger.warn("peer_candidate_gathering_done: #{inspect(cause)}")
412+
Logger.warning("peer_candidate_gathering_done: #{inspect(cause)}")
413413
{:reply, {:error, cause}, state}
414414
end
415415
end
@@ -449,8 +449,8 @@ defmodule ExLibnice do
449449
{:reply, :ok, state}
450450
end
451451
else
452-
candidate_check: _ -> {:reply, {:error, :failed_to_parse_sdp_string}, state}
453-
mdns_check: _ -> do_set_remote_candidate(candidate, stream_id, component_id, state)
452+
candidate_check: _x -> {:reply, {:error, :failed_to_parse_sdp_string}, state}
453+
mdns_check: _x -> do_set_remote_candidate(candidate, stream_id, component_id, state)
454454
end
455455
end
456456

@@ -462,7 +462,7 @@ defmodule ExLibnice do
462462
{:reply, :ok, state}
463463

464464
{{:error, cause}, state} ->
465-
Logger.warn("Couldn't restart ICE")
465+
Logger.warning("Couldn't restart ICE")
466466
{:reply, {:error, cause}, state}
467467
end
468468
end
@@ -475,7 +475,7 @@ defmodule ExLibnice do
475475
{:reply, :ok, state}
476476

477477
{{:error, cause}, state} ->
478-
Logger.warn("Couldn't restart stream #{inspect(stream_id)}")
478+
Logger.warning("Couldn't restart stream #{inspect(stream_id)}")
479479
{:reply, {:error, cause}, state}
480480
end
481481
end
@@ -487,7 +487,7 @@ defmodule ExLibnice do
487487
{:reply, :ok, state}
488488

489489
{{:error, cause}, state} ->
490-
Logger.warn("Couldn't send payload: #{inspect(cause)}")
490+
Logger.warning("Couldn't send payload: #{inspect(cause)}")
491491
{:reply, {:error, cause}, state}
492492
end
493493
end
@@ -546,7 +546,7 @@ defmodule ExLibnice do
546546
{:component_state_failed, _stream_id, _component_id} = msg,
547547
%State{parent: parent} = state
548548
) do
549-
Logger.warn("#{inspect(msg)}")
549+
Logger.warning("#{inspect(msg)}")
550550
send(parent, msg)
551551
{:noreply, state}
552552
end
@@ -578,7 +578,7 @@ defmodule ExLibnice do
578578

579579
@impl true
580580
def handle_info(msg, state) do
581-
Logger.warn("Unknown message #{inspect(msg)}")
581+
Logger.warning("Unknown message #{inspect(msg)}")
582582
{:noreply, state}
583583
end
584584

@@ -603,7 +603,7 @@ defmodule ExLibnice do
603603
defp do_set_relay_info(state, stream_id, :all, relay_info) do
604604
case Map.get(state.stream_components, stream_id) do
605605
nil ->
606-
Logger.warn("Couldn't set TURN servers. No stream with id #{inspect(stream_id)}")
606+
Logger.warning("Couldn't set TURN servers. No stream with id #{inspect(stream_id)}")
607607

608608
{{:error, :bad_stream_id}, state}
609609

@@ -621,7 +621,7 @@ defmodule ExLibnice do
621621
%{server_addr: server_addr, server_port: server_port, relay_type: relay_type}
622622
)
623623
when relay_type not in [:udp, :tcp, :tls] do
624-
Logger.warn("""
624+
Logger.warning("""
625625
Couldn't set TURN server #{inspect(server_addr)} #{inspect(server_port)} \
626626
#{inspect(relay_type)} for component: #{inspect(component_id)} in stream: \
627627
#{inspect(stream_id)}, cause: bad_relay_type
@@ -656,14 +656,14 @@ defmodule ExLibnice do
656656
{:ok, state}
657657
else
658658
{:error, :failed_to_lookup_addr} = err ->
659-
Logger.warn("""
659+
Logger.warning("""
660660
Couldn't lookup TURN server address #{inspect(server_addr)}
661661
""")
662662

663663
{err, state}
664664

665665
{{:error, cause}, _state} = ret ->
666-
Logger.warn("""
666+
Logger.warning("""
667667
Couldn't set TURN server #{inspect(server_addr)} #{inspect(server_port)} \
668668
#{inspect(relay_type)} for component: #{inspect(component_id)} in stream: \
669669
#{inspect(stream_id)}, cause: #{inspect(cause)}
@@ -680,7 +680,7 @@ defmodule ExLibnice do
680680
{:reply, :ok, state}
681681

682682
{{:error, cause}, state} ->
683-
Logger.warn("Couldn't set remote candidate: #{inspect(cause)}")
683+
Logger.warning("Couldn't set remote candidate: #{inspect(cause)}")
684684
{:reply, {:error, cause}, state}
685685
end
686686
end

mix.exs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule ExLibnice.MixProject do
22
use Mix.Project
33

4-
@version "0.8.0"
4+
@version "0.8.1"
55
@github_url "https://github.com/membraneframework/ex_libnice"
66

77
def project do
@@ -13,6 +13,7 @@ defmodule ExLibnice.MixProject do
1313
elixirc_paths: elixirc_paths(Mix.env()),
1414
start_permanent: Mix.env() == :prod,
1515
deps: deps(),
16+
dialyzer: dialyzer(),
1617

1718
# hex
1819
description: "Elixir wrapper over libnice",
@@ -41,12 +42,27 @@ defmodule ExLibnice.MixProject do
4142
{:unifex, "~> 1.0"},
4243
{:bunch, "~> 1.3.0"},
4344
{:mdns, "~> 1.0.12"},
44-
{:ex_doc, "~> 0.23", only: :dev, runtime: false},
45-
{:dialyxir, "~> 1.0", only: :dev, runtime: false},
46-
{:credo, "~> 1.5", only: :dev, runtime: false}
45+
{:ex_doc, "~> 0.34", only: :dev, runtime: false},
46+
{:dialyxir, "~> 1.4", only: :dev, runtime: false},
47+
{:credo, "~> 1.7", only: :dev, runtime: false}
4748
]
4849
end
4950

51+
defp dialyzer() do
52+
opts = [
53+
flags: [:error_handling],
54+
plt_add_apps: [:mix, :syntax_tools]
55+
]
56+
57+
if System.get_env("CI") == "true" do
58+
# Store PLTs in cacheable directory for CI
59+
File.mkdir_p!(Path.join([__DIR__, "priv", "plts"]))
60+
[plt_local_path: "priv/plts", plt_core_path: "priv/plts"] ++ opts
61+
else
62+
opts
63+
end
64+
end
65+
5066
defp package do
5167
[
5268
maintainers: ["Membrane Team"],

0 commit comments

Comments
 (0)