Skip to content

Bump actions/checkout from 3 to 4 #27

Bump actions/checkout from 3 to 4

Bump actions/checkout from 3 to 4 #27

Workflow file for this run

name: .NET
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read
checks: write
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
source-url: https://nuget.pkg.github.com/CompostInTraining/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal --logger "trx" --results-directory "./TestResults"
#- uses: dorny/test-reporter@v1
# if: always()
# with:
# name: .NET Test Results
# path: TestResults/*.trx
# reporter: dotnet-trx
- name: Pack NuGet(s)
run: dotnet pack -c Release -o packages
- name: Upload NuGet(s)
if: ${{ github.event_name != 'pull_request' }}
run: dotnet nuget push packages/*.nupkg --skip-duplicate