mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-07-30 17:30:40 +00:00
46 lines
1.6 KiB
YAML
46 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-and-audit:
|
|
runs-on: windows-latest
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install .NET SDK
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 10.0.x
|
|
|
|
- name: Restore solution and fail on vulnerable packages
|
|
run: dotnet restore Esiur.sln -p:NuGetAudit=true -p:NuGetAuditMode=all -p:NuGetAuditLevel=low '-warnaserror:NU1901;NU1902;NU1903;NU1904'
|
|
|
|
- name: Build and run unit tests
|
|
run: dotnet test Tests/Unit/Esiur.Tests.Unit.csproj --configuration Release --no-restore --verbosity minimal
|
|
|
|
- name: Build and run CLI tests
|
|
run: dotnet test Tests/Esiur.CLI.Tests/Esiur.CLI.Tests.csproj --configuration Release --no-restore --verbosity minimal
|
|
|
|
- name: Pack and install CLI tool
|
|
shell: pwsh
|
|
run: |
|
|
dotnet pack Tools/Esiur.CLI/Esiur.CLI.csproj --configuration Release --no-build --no-restore --output artifacts/nuget
|
|
dotnet tool install Esiur.CLI --version 3.0.0 --tool-path artifacts/tool --add-source artifacts/nuget
|
|
& ./artifacts/tool/esiur.exe version
|
|
& ./artifacts/tool/esiur.exe --help
|
|
|
|
- name: Build standalone web example
|
|
run: dotnet build Examples/StandaloneWebServer/Esiur.Examples.StandaloneWebServer.csproj --configuration Release --no-restore --verbosity minimal
|
|
|
|
- name: Audit direct and transitive packages
|
|
run: dotnet list Esiur.sln package --vulnerable --include-transitive
|