ceva #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
pull_request: | |
branches: ["master"] | |
env: | |
NUNIT_CONSOLE_VERSION: 3.18.1 | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore API's workload and dependencies | |
working-directory: ./API | |
run: | | |
dotnet workload restore | |
dotnet restore API.csproj | |
- name: Build API | |
working-directory: ./API | |
run: dotnet build --no-restore API.csproj | |
- name: Install NUnit.Console | |
working-directory: ./Tests | |
run: nuget install NUnit.Console -Version $NUNIT_CONSOLE_VERSION -DirectDownload -OutputDirectory . | |
- name: Restore Tests's workload and dependencies | |
working-directory: ./Tests | |
run: | | |
dotnet workload restore | |
dotnet restore | |
- name: Build Tests | |
working-directory: ./Tests | |
run: dotnet build --no-restore | |
- name: Run API | |
working-directory: ./API | |
env: | |
ASPNETCORE_ENVIRONMENT: Development | |
run: dotnet run --project ./API.csproj & | |
- name: Run Tests | |
working-directory: ./Tests | |
run: | | |
$runner = "./NUnit.ConsoleRunner.$NUNIT_CONSOLE_VERSION/tools/nunit3-console.exe" | |
& $Runner Tests.csproj |