Skip to content

Add tests to CI

Add tests to CI #19

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
checks: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Runtime Tests
run: dotnet test ./Tests/Reqnroll.RuntimeTests/Reqnroll.RuntimeTests.csproj --no-build --verbosity normal -f net6.0
- name: Plugin Tests
run: dotnet test ./Tests/Reqnroll.PluginTests/Reqnroll.PluginTests.csproj --no-build --verbosity normal -f net6.0
- name: Generator Tests
run: dotnet test ./Tests/Reqnroll.GeneratorTests/Reqnroll.GeneratorTests.csproj --no-build --verbosity normal -f net6.0
- name: ExternalData Plugin Tests
run: dotnet test ./Plugins/Reqnroll.ExternalData/Reqnroll.ExternalData.ReqnrollPlugin.UnitTests/Reqnroll.ExternalData.ReqnrollPlugin.UnitTests.csproj --no-build --verbosity normal -f net6.0
specs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Set .NET 6 SDK
run: dotnet new globaljson --sdk-version 6.0.418
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: xUnit Specs
run: dotnet test ./Tests/Reqnroll.Specs/Reqnroll.Specs.csproj --no-build --verbosity normal -f net6.0 --filter "Category=xUnit&Category=Net60" --logger "trx;LogFileName=specs-xunit-results.trx" || true
- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: DotNET Tests
path: "**/specs-*.trx"
reporter: dotnet-trx
fail-on-error: true