-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (74 loc) · 2.75 KB
/
build_and_coverage.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
name: Build Test and Coverage
on:
push:
branches:
- 'main'
pull_request:
jobs:
Build_Test_Coverage:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Restore Nuget Packages
run: dotnet restore SectorFileCompiler.sln --packages packages
- name: Run Build
run: dotnet build /p:Configuration=Release SectorFileCompiler.sln --nologo --no-restore /warnaserror;
- name: Run Compiler Tests With Coverage
if: matrix.platform == 'ubuntu-latest'
run: |
cd tests/CompilerTest
dotnet dotcover test --dcReportType=DetailedXml --dcOutput=../../coverage/Compiler.xml
- name: Run Compiler Tests
if: matrix.platform != 'ubuntu-latest'
run: |
cd tests/CompilerTest
dotnet test
- name: Run Compiler CLI Tests With Coverage
if: matrix.platform == 'ubuntu-latest'
run: |
cd tests/CompilerCliTest
dotnet dotcover test --dcReportType=DetailedXml --dcOutput=../../coverage/CompilerCli.xml
- name: Run Compiler CLI Tests
if: matrix.platform != 'ubuntu-latest'
run: |
cd tests/CompilerCliTest
dotnet test
- name: Publish Assets
if: matrix.platform == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .\.github\workflows\publish.ps1
shell: powershell
- name: Upload Windows Assets
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: "cli-windows-x64"
path: "publish/windows/CompilerCli.exe"
- name: Upload Linux Assets
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: "cli-linux-x64"
path: "publish/linux/CompilerCli"
- name: Upload OSX Assets
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: "cli-osx-x64"
path: "publish/osx/CompilerCli"
- name: Upload Code Coverage Reports
if: matrix.platform == 'ubuntu-latest'
run: |
cd coverage
bash <(curl -s https://codecov.io/bash) -f *.xml
# If we're building on main, lets do a release
- name: Create Release
if: github.ref == 'refs/heads/main' && matrix.platform == 'windows-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release@17