Skip to content

Merge pull request #10 from CompostInTraining/ci-fix #24

Merge pull request #10 from CompostInTraining/ci-fix

Merge pull request #10 from CompostInTraining/ci-fix #24

Workflow file for this run

name: .NET
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
steps:
- uses: actions/checkout@v3
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