Skip to content

Merge pull request #15 from yoyoboot/fix-9.1-ci-sdkversion #4

Merge pull request #15 from yoyoboot/fix-9.1-ci-sdkversion

Merge pull request #15 from yoyoboot/fix-9.1-ci-sdkversion #4

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: "build and test"
on:
push:
paths:
- '**/*.cs'
- '**/*.cshtml'
- '**/*.csproj'
- '**/*.razor'
pull_request:
paths:
- '**/*.cs'
- '**/*.cshtml'
- '**/*.csproj'
- '**/*.razor'
jobs:
build:
runs-on: windows-latest
steps:
# 拉取代码
- uses: actions/checkout@v4
# 配置dotnet环境
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
# 缓存nuget
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-build-nuget-${{ env.CACHE_NAME }}-
# 还原依赖
- name: Restore
run: dotnet restore
# 以默认形式编译
- name: Build
run: dotnet build --no-restore
# 执行单元测试
- name: Test
run: dotnet test --no-build --verbosity normal