Skip to content

Bump the nuget-dependencies group with 14 updates #273

Bump the nuget-dependencies group with 14 updates

Bump the nuget-dependencies group with 14 updates #273

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: .NET
on:
# - all PRs commits and when PR is unlocked (an easy way to trigger the workflow).
# - push to `main` to register baseline code coverage and test results with Codecov.
# - manual execution
pull_request: { types: [opened, synchronize, reopened, unlocked] }
push: { branches: [main] }
workflow_dispatch:
permissions:
contents: read # required for cloning the repo
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build:
# Note: Our tests depend on linux containers, such as Redis, but
# Windows runners don't support linux containers and MacOS runners
# don't support containers at all. So we're limited to linux runners for now.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
# Cache NuGet packages to speed up builds
- uses: actions/cache@v6
with:
path: ~/.nuget/packages
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
# We don't use a package lock so we can't key off that, but we can
# use the hash of all project files to invalidate the cache when
# dependencies change.
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.*.props') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Package
run: dotnet pack --no-build --configuration Release
- name: Test # also collects code coverage
id: test
run: |
dotnet test --no-build --configuration Release \
--verbosity normal \
--logger "junit;LogFilePath=TestResults/junit.xml" \
-p:CollectCoverage=true \
-p:CoverletOutputFormat=cobertura \
-p:CoverletOutput=coverage
- name: Upload coverage
uses: codecov/codecov-action@v7
with:
files: "tests/**/coverage.cobertura.xml"
token: ${{ secrets.CODECOV_TOKEN }}
codecov_yml_path: .github/codecov.yml
- name: Upload test results
# always upload test results, even if the tests fail
if: always() && (steps.test.outcome == 'failure' || steps.test.outcome == 'success')
uses: codecov/codecov-action@v7
with:
report_type: test_results
files: "tests/**/TestResults/junit.xml"
token: ${{ secrets.CODECOV_TOKEN }}
codecov_yml_path: .github/codecov.yml