Skip to content

CI remove building before testing #34

CI remove building before testing

CI remove building before testing #34

Workflow file for this run

# .github/workflows/dotnet.yml
name: .NET Build and Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# 1. Checkout the repository with a shallow clone
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1 # Shallow clone for faster checkouts
# 2. Setup .NET SDK with exact version
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x # Specify the exact SDK version
# 3. Cache NuGet packages
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.sln') }}
restore-keys: |
${{ runner.os }}-nuget-
# 4. Restore dependencies
- name: Restore dependencies
run: dotnet restore
# 5. Run tests with parallel execution
- name: Test
run: dotnet test --verbosity normal