-
Notifications
You must be signed in to change notification settings - Fork 4
91 lines (82 loc) · 2.7 KB
/
build-ci.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
name: Build - CI
on:
push:
branches: [ master ]
jobs:
build-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-restore --no-build
coverage-ci:
needs: build-ci
runs-on: ubuntu-latest
strategy:
matrix:
test_path:
- src/tests/SoloX.GeneratorTools.Core.UTest
- src/tests/SoloX.GeneratorTools.Core.CSharp.UTest
- src/tests/SoloX.GeneratorTools.Core.CSharp.ITest
- src/tools.tests/SoloX.GeneratorTools.Generator.ITest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100
- name: Install dependencies ${{ matrix.test_path }}
run: dotnet restore ${{ matrix.test_path }}
- name: Build ${{ matrix.test_path }}
run: dotnet build ${{ matrix.test_path }} --configuration Release --no-restore
- name: Test Coverage ${{ matrix.test_path }}
run: dotnet test ${{ matrix.test_path }} --configuration Release --no-restore --no-build --collect:"XPlat Code Coverage" --settings coverlet.runsettings
- name: Moving test results
run: mv ${{ matrix.test_path }}/TestResults/**/coverage.cobertura.xml ${{ matrix.test_path }}/TestResults/coverage.cobertura.xml
- name: Send to coverals
uses: coverallsapp/github-action@v2.2.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.test_path }}/TestResults/coverage.cobertura.xml
format: cobertura
flag-name: test-${{ matrix.test_path }}
parallel: true
end-coverage-ci:
needs: coverage-ci
runs-on: ubuntu-latest
steps:
- name: Finish coverals
uses: coverallsapp/github-action@v2.2.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
pack-ci:
needs: build-ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Pack
run: dotnet pack --configuration Release --no-restore --no-build
- name: Upload Packages
uses: actions/upload-artifact@v3
with:
name: 'NugetPackages'
path: |
src/**/*.nupkg
src/**/*.snupkg