@@ -24,11 +24,30 @@ jobs:
2424 - name : Check Format (*.cs)
2525 run : dotnet format --verify-no-changes --verbosity diagnostic
2626
27+ Build-Test-Neo-Cli :
28+ needs : [Format]
29+ timeout-minutes : 15
30+ runs-on : ubuntu-latest
31+ steps :
32+ - name : Checkout
33+ uses : actions/checkout@v4
34+
35+ - name : Setup .NET
36+ uses : actions/setup-dotnet@v4
37+ with :
38+ dotnet-version : ${{ env.DOTNET_VERSION }}
39+
2740 - name : Build (Neo.CLI)
41+ run : dotnet build ./src/Neo.CLI --output ./out/Neo.CLI
42+
43+ - name : Install dependencies
2844 run : |
29- dotnet build ./src/Neo.CLI \
30- --output ./out/Neo.CLI
45+ sudo apt-get install libleveldb-dev expect
46+ find ./out -name 'config.json' | xargs perl -pi -e 's|LevelDBStore|MemoryStore|g'
3147
48+ - name : Run tests with expect
49+ run : expect ./scripts/Neo.CLI/test-neo-cli.expect
50+
3251 Test :
3352 needs : [Format]
3453 timeout-minutes : 15
@@ -39,15 +58,18 @@ jobs:
3958 steps :
4059 - name : Checkout
4160 uses : actions/checkout@v4
61+
4262 - name : Setup .NET
4363 uses : actions/setup-dotnet@v4
4464 with :
4565 dotnet-version : ${{ env.DOTNET_VERSION }}
66+
4667 - name : Test
4768 if : matrix.os != 'ubuntu-latest'
4869 run : |
4970 dotnet sln neo.sln remove ./tests/Neo.Plugins.Storage.Tests/Neo.Plugins.Storage.Tests.csproj
5071 dotnet test
72+
5173 - name : Test for coverall
5274 if : matrix.os == 'ubuntu-latest'
5375 run : |
@@ -139,14 +161,17 @@ jobs:
139161 steps :
140162 - name : Checkout
141163 uses : actions/checkout@v4
164+
142165 - name : Get version
143166 id : get_version
144167 run : |
145168 sudo apt install xmlstarlet
146169 find src -name Directory.Build.props | xargs xmlstarlet sel -N i=http://schemas.microsoft.com/developer/msbuild/2003 -t -v "concat('::set-output name=version::v',//i:VersionPrefix/text())" | xargs echo
170+
147171 - name : Check tag
148172 id : check_tag
149173 run : curl -s -I ${{ format('https://github.com/{0}/releases/tag/{1}', github.repository, steps.get_version.outputs.version) }} | head -n 1 | cut -d$' ' -f2 | xargs printf "::set-output name=statusCode::%s" | xargs echo
174+
150175 - name : Create release
151176 if : steps.check_tag.outputs.statusCode == '404'
152177 id : create_release
@@ -157,53 +182,62 @@ jobs:
157182 tag_name : ${{ steps.get_version.outputs.version }}
158183 release_name : ${{ steps.get_version.outputs.version }}
159184 prerelease : ${{ contains(steps.get_version.outputs.version, '-') }}
185+
160186 - name : Setup .NET
161187 if : steps.check_tag.outputs.statusCode == '404'
162188 uses : actions/setup-dotnet@v4
163189 with :
164190 dotnet-version : ${{ env.DOTNET_VERSION }}
191+
165192 - name : Pack (Neo)
166193 if : steps.check_tag.outputs.statusCode == '404'
167194 run : |
168195 dotnet pack ./src/Neo \
169196 --configuration Release \
170197 --output ./out
198+
171199 - name : Pack (Neo.IO)
172200 if : steps.check_tag.outputs.statusCode == '404'
173201 run : |
174202 dotnet pack ./src/Neo.IO \
175203 --configuration Release \
176204 --output ./out
205+
177206 - name : Pack (Neo.Extensions)
178207 if : steps.check_tag.outputs.statusCode == '404'
179208 run : |
180209 dotnet pack ./src/Neo.Extensions \
181210 --configuration Release \
182211 --output ./out
212+
183213 - name : Pack (Neo.Json)
184214 if : steps.check_tag.outputs.statusCode == '404'
185215 run : |
186216 dotnet pack ./src/Neo.Json \
187217 --configuration Release \
188218 --output ./out
219+
189220 - name : Pack (Neo.VM)
190221 if : steps.check_tag.outputs.statusCode == '404'
191222 run : |
192223 dotnet pack ./src/Neo.VM \
193224 --configuration Release \
194225 --output ./out
226+
195227 - name : Pack (Neo.ConsoleService)
196228 if : steps.check_tag.outputs.statusCode == '404'
197229 run : |
198230 dotnet pack ./src/Neo.ConsoleService \
199231 --configuration Release \
200232 --output ./out
233+
201234 - name : Pack (Neo.Cryptography.BLS12_381)
202235 if : steps.check_tag.outputs.statusCode == '404'
203236 run : |
204237 dotnet pack ./src/Neo.Cryptography.BLS12_381 \
205238 --configuration Release \
206239 --output ./out
240+
207241 - name : Publish to NuGet
208242 if : steps.check_tag.outputs.statusCode == '404'
209243 run : |
0 commit comments