-
Notifications
You must be signed in to change notification settings - Fork 96
154 lines (130 loc) · 5.71 KB
/
main.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
name: .NET Core Test and Publish
on:
push:
branches: [master]
pull_request:
env:
DOTNET_VERSION: 8.0.x
jobs:
Format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Check Format (*.cs)
run: dotnet format --verify-no-changes --verbosity diagnostic
Test-Everything:
needs: [Format]
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build (Everything)
run: dotnet build
- name: Install dependencies
run: |
sudo apt-get install libleveldb-dev expect
find ./bin -name 'config.json' | xargs perl -pi -e 's|LevelDBStore|MemoryStore|g'
- name: Run tests with expect
run: expect ./scripts/EpicChain.CLI/test-epicchain-cli.exp
Test:
needs: [Format]
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Test
if: matrix.os != 'ubuntu-latest'
run: |
dotnet sln epicchain.sln remove ./tests/EpicChain.Plugins.Storage.Tests/EpicChain.Plugins.Storage.Tests.csproj
dotnet build
dotnet test --blame-hang --blame-crash --no-build
- name: Test for coverall
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get --assume-yes install libleveldb-dev librocksdb-dev
dotnet test ./tests/EpicChain.Cryptography.BLS12_381.Tests --output ./bin/tests/EpicChain.Cryptography.BLS12_381.Tests
dotnet test ./tests/EpicChain.ConsoleService.Tests --output ./bin/tests/EpicChain.ConsoleService.Tests
dotnet test ./tests/EpicChain.UnitTests --output ./bin/tests/EpicChain.UnitTests
dotnet test ./tests/EpicChain.VM.Tests --output ./bin/tests/EpicChain.VM.Tests
dotnet test ./tests/EpicChain.Json.UnitTests --output ./bin/tests/EpicChain.Json.UnitTests
dotnet test ./tests/EpicChain.Extensions.Tests --output ./bin/tests/EpicChain.Extensions.Tests
# Plugins
dotnet test ./tests/EpicChain.Cryptography.MPTTrie.Tests --output ./bin/tests/EpicChain.Cryptography.MPTTrie.Tests
dotnet test ./tests/EpicChain.Network.RPC.Tests --output ./bin/tests/EpicChain.Network.RPC.Tests
dotnet test ./tests/EpicChain.Plugins.OracleService.Tests --output ./bin/tests/EpicChain.Plugins.OracleService.Tests
dotnet test ./tests/EpicChain.Plugins.RpcServer.Tests --output ./bin/tests/EpicChain.Plugins.RpcServer.Tests
dotnet test ./tests/EpicChain.Plugins.Storage.Tests --output ./bin/tests/EpicChain.Plugins.Storage.Tests
dotnet test ./tests/EpicChain.Plugins.ApplicationLogs.Tests --output ./bin/tests/EpicChain.Plugins.ApplicationLogs.Tests
- name: Coveralls
if: matrix.os == 'ubuntu-latest'
uses: coverallsapp/github-action@v2.3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
files:
${{ github.workspace }}/tests/EpicChain.Cryptography.BLS12_381.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.ConsoleService.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.UnitTests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.VM.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.Json.UnitTests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.Cryptography.MPTTrie.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.Network.RPC.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.Plugins.OracleService.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.Plugins.RpcServer.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.Plugins.Storage.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.Plugins.ApplicationLogs.Tests/TestResults/coverage.info
${{ github.workspace }}/tests/EpicChain.Extensions.Tests/TestResults/coverage.info
PublishPackage:
if: github.ref == 'refs/heads/master' && startsWith(github.repository, 'epicchainlabs/')
needs: [Test]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Set Version
run: git rev-list --count HEAD | xargs printf 'CI%05d' | xargs -I{} echo 'VERSION_SUFFIX={}' >> $GITHUB_ENV
- name : Pack (Everything)
run: |
dotnet pack \
--configuration Release \
--output ./out \
--version-suffix ${{ env.VERSION_SUFFIX }}
- name: Publish to Github Packages
working-directory: ./out
run: |
dotnet nuget push * \
--source https://nuget.pkg.github.com/epicchainlabs/index.json \
--api-key "${{ secrets.GITHUB_TOKEN }}" \
--disable-buffering \
--no-service-endpoint
- name: Publish to myGet
working-directory: ./out
run: |
dotnet nuget push * \
--source https://www.myget.org/F/neo/api/v3/index.json \
--api-key "${{ secrets.MYGET_TOKEN }}" \
--disable-buffering \
--no-service-endpoint