-
Notifications
You must be signed in to change notification settings - Fork 138
197 lines (193 loc) · 6.66 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: Release
on:
release:
types:
- created
# Test trigger. Uncomment to test basic flow.
# NOTE: it will fail on trying to get the release url
# on:
# push:
# branches:
# - '*'
jobs:
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 crypto compiler 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
# Make release artifacts : erlang_ls
- name: Make erlang_ls-linux-${{ matrix.otp-version }}.tar.gz
run: 'tar -zcvf erlang_ls-linux-${{ matrix.otp-version }}.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-linux-${{ matrix.otp-version }}.tar.gz
uses: "actions/[email protected]"
with:
asset_content_type: application/octet-stream
asset_name: "erlang_ls-linux-${{ matrix.otp-version }}.tar.gz"
asset_path: "erlang_ls-linux-${{ matrix.otp-version }}.tar.gz"
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"
windows:
strategy:
matrix:
platform: [windows-latest]
otp-version: [26.2.5.3]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Erlang
run: choco install -y erlang --version ${{ matrix.otp-version }}
- name: Install rebar3
run: choco install -y rebar3 --version 3.23.0
- 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: 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
# Make release artifacts : erlang_ls
- name: Make erlang_ls-windows-${{ matrix.otp-version }}.tar.gz
run: 'tar -zcvf erlang_ls-windows-${{ matrix.otp-version }}.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-windows-${{ matrix.otp-version }}.tar.gz
uses: "actions/[email protected]"
with:
asset_content_type: application/octet-stream
asset_name: erlang_ls-windows-${{ matrix.otp-version }}.tar.gz
asset_path: erlang_ls-windows-${{ matrix.otp-version }}.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
- name: Escriptize LSP Server
run: rebar3 escriptize
# Make release artifacts : erlang_ls
- name: Make erlang_ls-macos-${{ matrix.otp-version }}.tar.gz
run: 'tar -zcvf erlang_ls-macos-${{ matrix.otp-version }}.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-macos-${{ matrix.otp-version }}.tar.gz
uses: "actions/[email protected]"
with:
asset_content_type: application/octet-stream
asset_name: erlang_ls-macos-${{ matrix.otp-version }}.tar.gz
asset_path: erlang_ls-macos-${{ matrix.otp-version }}.tar.gz
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"