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

Workflows macos #1552

Merged
merged 6 commits into from
Sep 30, 2024
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: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,24 @@ jobs:
run: rebar3 do dialyzer, xref
- name: Produce Documentation
run: rebar3 edoc
macos:
# Smaller job for MacOS to avoid excessive billing
strategy:
matrix:
platform: [macos-latest]
otp-version: [27]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Install Erlang
run: brew install erlang@${{ matrix.otp-version }}
- name: Install Rebar3
run: brew install rebar3
- name: Compile
run: rebar3 compile
- name: Generate Dialyzer PLT for usage in CT Tests
run: dialyzer --build_plt --apps erts kernel stdlib compiler crypto parsetools
- name: Start epmd as daemon
run: epmd -daemon
- name: Run CT Tests
run: rebar3 ct
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,35 @@ jobs:
asset_name: erlang_ls-win32.tar.gz
asset_path: erlang_ls-win32.tar.gz
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"
macos:
# Smaller job for MacOS to avoid excessive billing
strategy:
matrix:
platform: [macos-latest]
otp-version: [24, 25, 26, 27]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Install Erlang
run: brew install erlang@${{ matrix.otp-version }}
- name: Install Rebar3
run: brew install rebar3
- name: Compile
run: rebar3 compile
# Make release artifacts : erlang_ls
- name: Make erlang_ls-${{ matrix.otp-version }}-macos.tar.gz
run: 'tar -zcvf erlang_ls-${{ matrix.otp-version }}-macos.tar.gz -C _build/default/bin/ erlang_ls'
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
id: get_release_url
name: Get release url
uses: "bruceadams/[email protected]"
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
name: Upload release erlang_ls-${{ matrix.otp-version }}-macos.tar.gz
uses: "actions/[email protected]"
with:
asset_content_type: application/octet-stream
asset_name: erlang_ls-${{ matrix.otp-version }}-macos.tar.gz
asset_path: erlang_ls-${{ matrix.otp-version }}-macos.tar.gz
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"
13 changes: 11 additions & 2 deletions apps/els_lsp/test/els_diagnostics_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ use_long_names_no_domain(_Config) ->
NodeName =
"my_node@" ++ HostName,
Node = list_to_atom(NodeName),
?assertMatch(Node, els_config_runtime:get_node_name()),
?assertMatch(Node, strip_local(els_config_runtime:get_node_name())),
ok.

-spec use_long_names_custom_hostname(config()) -> ok.
Expand All @@ -677,7 +677,7 @@ use_long_names_custom_hostname(_Config) ->
NodeName = "[email protected]",
Node = list_to_atom(NodeName),
?assertMatch(HostName, "127.0.0.1"),
?assertMatch(Node, els_config_runtime:get_node_name()),
?assertMatch(Node, strip_local(els_config_runtime:get_node_name())),
ok.

-spec epp_with_nonexistent_macro(config()) -> ok.
Expand Down Expand Up @@ -1066,6 +1066,15 @@ unused_macros_refactorerl(_Config) ->
%%==============================================================================
%% Internal Functions
%%==============================================================================
strip_local(Node) ->
list_to_atom(strip_local(atom_to_list(Node), [])).

strip_local([], Acc) ->
lists:reverse(Acc);
strip_local(".local", Acc) ->
lists:reverse(Acc);
strip_local([H | T], Acc) ->
strip_local(T, [H | Acc]).

mock_compiler_telemetry_enabled() ->
meck:new(els_config, [passthrough, no_link]),
Expand Down
Loading