Update publish.yml #3
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
# https://github.com/rhysd/actionlint | |
name: Build-Test | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/doc/cloudbuild.md#github-actions | |
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" | |
# https://github.com/joseftw/jos.enumeration/blob/main/.github/workflows/verify.yml | |
# https://github.com/dotnet/Nerdbank.GitVersioning | |
- uses: dotnet/[email protected] | |
id: nbgv | |
- name: Cache NuGet Packages | |
uses: actions/cache@v3 | |
with: | |
key: vertical-template-nuget | |
path: ~/.nuget/packages | |
- name: Restore dependencies | |
run: dotnet restore Vertical.Slice.Template.sln | |
- name: Build Version ${{ steps.nbgv.outputs.nugetpackageversion }} | |
run: dotnet build Vertical.Slice.Template.sln -c Release --no-restore | |
- name: Test Version ${{ steps.nbgv.outputs.nugetpackageversion }} | |
run: | | |
dotnet test Vertical.Slice.Template.sln -c Release --no-restore --no-build |