Skip to content

Update build system (#431) #899

Update build system (#431)

Update build system (#431) #899

Workflow file for this run

name: Code Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: windows-2019
env:
AppVeyorBuild: true
CoverageBuild: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Setup .NET 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Setup .NET 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Setup .NET 5
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Install CodeCov
working-directory: src
run: dotnet tool install --global Codecov.Tool
- name: Install Coverlet
working-directory: src
run: dotnet tool install --global coverlet.console
- name: Build FlatSharp.Compiler
working-directory: src/FlatSharp.Compiler
run: dotnet build -c Debug /p:SignAssembly=false
- name: Run FlatSharp.Compiler (E2E Tests)
# You may pin to the exact commit or the version.
# uses: Amadevus/pwsh-script@97a8b211a5922816aa8a69ced41fa32f23477186
uses: Amadevus/pwsh-script@v2.0.3
with:
# PowerShell script to execute in Actions-hydrated context
script: |
$fbs = (gci -r src/tests/FlatsharpEndToEndTests/*.fbs) -join ";"
coverlet `
.\src\FlatSharp.Compiler\bin\Debug\net8.0 `
--skipautoprops `
--use-source-link `
--format opencover `
--target "dotnet" `
--output e2etests.coverage.xml `
--targetargs "src\FlatSharp.Compiler\bin\Debug\net8.0\FlatSharp.Compiler.dll --nullable-warnings false --normalize-field-names true --input `"$fbs`" -o src/tests/FlatSharpEndToEndTests"
- name: Run FlatSharp.Compiler (Pooling Tests)
# You may pin to the exact commit or the version.
# uses: Amadevus/pwsh-script@97a8b211a5922816aa8a69ced41fa32f23477186
uses: Amadevus/pwsh-script@v2.0.3
with:
# PowerShell script to execute in Actions-hydrated context
script: |
$fbs = (gci -r src/tests/FlatSharpPoolableEndToEndTests/*.fbs) -join ";"
coverlet `
.\src\FlatSharp.Compiler\bin\Debug\net8.0 `
--skipautoprops `
--use-source-link `
--format opencover `
--target "dotnet" `
--output pooling.coverage.xml `
--targetargs "src\FlatSharp.Compiler\bin\Debug\net8.0\FlatSharp.Compiler.dll --nullable-warnings false --normalize-field-names true --gen-poolable true --input `"$fbs`" -o src/tests/FlatSharpPoolableEndToEndTests"
- name: Run FlatSharp.Compiler (Stryker Tests)
# You may pin to the exact commit or the version.
# uses: Amadevus/pwsh-script@97a8b211a5922816aa8a69ced41fa32f23477186
uses: Amadevus/pwsh-script@v2.0.3
with:
# PowerShell script to execute in Actions-hydrated context
script: |
$fbs = (gci -r src/tests/Stryker/*.fbs) -join ";"
coverlet `
.\src\FlatSharp.Compiler\bin\Debug\net8.0 `
--skipautoprops `
--use-source-link `
--format opencover `
--target "dotnet" `
--output stryker.coverage.xml `
--targetargs "src/FlatSharp.Compiler/bin/Debug/net8.0/FlatSharp.Compiler.dll --nullable-warnings false --normalize-field-names true --input `"$fbs`" -o src/tests/Stryker/CodeGen --mutation-testing-mode"
- name: E2E Tests
working-directory: src
run: dotnet test Tests/FlatSharpEndToEndTests -c Debug -p:SignAssembly=false --collect:"XPlat Code Coverage" --settings Tests/coverlet.runsettings -f net8.0
- name: E2E Tests (Poolable)
working-directory: src
run: dotnet test Tests/FlatSharpPoolableEndToEndTests -c Debug -p:SignAssembly=false --collect:"XPlat Code Coverage" --settings Tests/coverlet.runsettings -f net8.0
- name: Compiler Tests
working-directory: src
run: dotnet test Tests/FlatSharpCompilerTests -c Debug -p:SignAssembly=false --collect:"XPlat Code Coverage" --settings Tests/coverlet.runsettings -f net8.0
- name: Stryker Tests
working-directory: src
run: dotnet test Tests/Stryker/Tests -c Debug -p:SignAssembly=false --collect:"XPlat Code Coverage" --settings Tests/coverlet.runsettings -f net8.0
- name: Upload
run: codecov -f **/*coverage*.xml