forked from neo-project/neo-node
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.43 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
name: .NET Core Test
on: pull_request
env:
DOTNET_VERSION: 7.0.x
jobs:
Test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Check format
if: runner.os == 'Linux'
run: dotnet format --no-restore --verify-no-changes --verbosity diagnostic
- name: Build CLI
if: runner.os == 'Linux'
run: |
dotnet publish -o ./out -c Release neo-cli
find ./out -name 'config.json' | xargs perl -pi -e 's|LevelDBStore|MemoryStore|g'
- name: Install dependencies
if: runner.os == 'Linux'
run: sudo apt-get install libleveldb-dev expect
- name: Run tests with expect
if: runner.os == 'Linux'
run: expect ./.github/workflows/test-neo-cli.expect
- name: Run Unit Tests
if: runner.os == 'Windows'
run: |
forfiles /p tests /m *.csproj /s /c "cmd /c dotnet add @PATH package coverlet.msbuild"
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage/lcov
- name: Coveralls
if: runner.os == 'Windows'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: \coverage\lcov.info