Skip to content

Commit

Permalink
Add macos to release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
plux committed Sep 18, 2024
1 parent 0f0dc60 commit a9f057f
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 110 deletions.
212 changes: 102 additions & 110 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,41 @@ on:
- opened
- synchronize
jobs:
macos:
linux:
strategy:
matrix:
platform: [macos-latest-x64, macos-latest-arm]
# No otp 27 in brew yet
otp-version: [24, 25, 26]
platform: [ubuntu-latest]
otp-version: [24, 25, 26, 27]
runs-on: ${{ matrix.platform }}
container:
image: erlang:${{ matrix.otp-version }}
steps:
- uses: actions/checkout@v2
- name: Install Erlang
run: brew install erlang@${{ matrix.otp-version }}
- name: Install Rebar3
run: brew install rebar3
- name: Checkout
uses: actions/checkout@v2
- name: Cache Hex packages
uses: actions/cache@v1
with:
path: ~/.cache/rebar3/hex/hexpm/packages
key: ${{ runner.os }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
restore-keys: |
${{ runner.os }}-hex-
- name: Cache Dialyzer PLTs
uses: actions/cache@v1
with:
path: ~/.cache/rebar3/rebar3_*_plt
key: ${{ runner.os }}-dialyzer-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }}
restore-keys: |
${{ runner.os }}-dialyzer-
- name: Compile
run: rebar3 compile
- name: Escriptize LSP Server
run: rebar3 escriptize
# - name: Store LSP Server Escript
# uses: actions/upload-artifact@v4
# with:
# name: erlang_ls
# path: _build/default/bin/erlang_ls
# overwrite: true
- name: Check formatting
run: rebar3 fmt -c
- name: Lint
Expand All @@ -33,108 +53,80 @@ jobs:
run: epmd -daemon
- name: Run CT Tests
run: rebar3 ct
# - name: Store CT Logs
# uses: actions/upload-artifact@v4
# with:
# name: ct-logs
# path: _build/test/logs
# overwrite: true
- name: Run PropEr Tests
run: rebar3 proper --cover --constraint_tries 100
- name: Run Checks
run: rebar3 do dialyzer, xref
- name: Create Cover Reports
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: rebar3 do cover, coveralls send
# - name: Produce Documentation
# run: rebar3 edoc
# if: ${{ matrix.otp-version == '24' }}
# - name: Publish Documentation
# uses: actions/upload-artifact@v4
# with:
# name: edoc
# path: |
# apps/els_core/doc
# apps/els_lsp/doc
# overwrite: true
windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Erlang
run: choco install -y erlang --version 26.2.5
- name: Install rebar3
run: choco install -y rebar3 --version 3.23.0
- name: Compile
run: rebar3 compile
- name: Lint
run: rebar3 lint
- name: Generate Dialyzer PLT for usage in CT Tests
run: dialyzer --build_plt --apps erts kernel stdlib crypto compiler parsetools
- name: Start epmd as daemon
run: erl -sname a -noinput -eval "halt(0)."
- name: Run CT Tests
run: rebar3 ct
# - name: Store CT Logs
# uses: actions/upload-artifact@v4
# with:
# name: ct-logs
# path: _build/test/logs
# overwrite: true
- name: Run PropEr Tests
run: rebar3 proper --cover --constraint_tries 100
- name: Run Checks
run: rebar3 do dialyzer, xref
# linux:
# strategy:
# matrix:
# platform: [ubuntu-latest]
# otp-version: [24, 25, 26, 27]
# runs-on: ${{ matrix.platform }}
# container:
# image: erlang:${{ matrix.otp-version }}
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Cache Hex packages
# uses: actions/cache@v1
# with:
# path: ~/.cache/rebar3/hex/hexpm/packages
# key: ${{ runner.os }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
# restore-keys: |
# ${{ runner.os }}-hex-
# - name: Cache Dialyzer PLTs
# uses: actions/cache@v1
# with:
# path: ~/.cache/rebar3/rebar3_*_plt
# key: ${{ runner.os }}-dialyzer-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }}
# restore-keys: |
# ${{ runner.os }}-dialyzer-
# - name: Compile
# run: rebar3 compile
# - name: Escriptize LSP Server
# run: rebar3 escriptize
# # - name: Store LSP Server Escript
# # uses: actions/upload-artifact@v4
# # with:
# # name: erlang_ls
# # path: _build/default/bin/erlang_ls
# # overwrite: true
# - name: Check formatting
# run: rebar3 fmt -c
# - name: Lint
# run: rebar3 lint
# - 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
# # - name: Store CT Logs
# # uses: actions/upload-artifact@v4
# # with:
# # name: ct-logs
# # path: _build/test/logs
# # overwrite: true
# - name: Run PropEr Tests
# run: rebar3 proper --cover --constraint_tries 100
# - name: Run Checks
# run: rebar3 do dialyzer, xref
# - name: Create Cover Reports
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: rebar3 do cover, coveralls send
# # - name: Produce Documentation
# # run: rebar3 edoc
# # if: ${{ matrix.otp-version == '24' }}
# # - name: Publish Documentation
# # uses: actions/upload-artifact@v4
# # with:
# # name: edoc
# # path: |
# # apps/els_core/doc
# # apps/els_lsp/doc
# # overwrite: true
# windows:
# runs-on: windows-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Install Erlang
# run: choco install -y erlang --version 26.2.5
# - name: Install rebar3
# run: choco install -y rebar3 --version 3.23.0
# - name: Compile
# run: rebar3 compile
# - name: Lint
# run: rebar3 lint
# - name: Generate Dialyzer PLT for usage in CT Tests
# run: dialyzer --build_plt --apps erts kernel stdlib crypto compiler parsetools
# - name: Start epmd as daemon
# run: erl -sname a -noinput -eval "halt(0)."
# - name: Run CT Tests
# run: rebar3 ct
# # - name: Store CT Logs
# # uses: actions/upload-artifact@v4
# # with:
# # name: ct-logs
# # path: _build/test/logs
# # overwrite: true
# - name: Run PropEr Tests
# run: rebar3 proper --cover --constraint_tries 100
# - name: Run Checks
# run: rebar3 do dialyzer, xref
# - name: Produce Documentation
# run: rebar3 edoc
- name: Produce Documentation
run: rebar3 edoc
macos:
# Smaller job for MacOS to avoid excessive billing
strategy:
matrix:
platform: [macos-latest-x64]
otp-version: [26]
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
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,42 @@ 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-arm]
otp-version: [26]
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

# Make release artifacts : erlang_ls
- name: Make erlang_ls-${{ matrix.otp-version }}-macos-arm.tar.gz
run: 'tar -zcvf erlang_ls-${{ matrix.otp-version }}-macos-arm.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-arm.tar.gz
uses: "actions/[email protected]"
with:
asset_content_type: application/octet-stream
asset_name: erlang_ls-${{ matrix.otp-version }}-macos-arm.tar.gz
asset_path: erlang_ls-${{ matrix.otp-version }}-macos-arm.tar.gz
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"

0 comments on commit a9f057f

Please sign in to comment.