Update README.md #42
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
# | |
# This workflow will build and run all unit tests. | |
# | |
name: dotnet-ci | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main", "feature*" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
configuration: [Release, Debug] | |
runs-on: ${{ matrix.os }} | |
env: | |
NUGET_CERT_REVOCATION_MODE: offline | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
clean: true | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.nuget/packages | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget | |
- name: Find solutions | |
shell: bash | |
run: echo "solutions=$(find . -type f -name "*.sln" | tr '\n' ' ')" >> $GITHUB_ENV | |
- name: Restore dependencies | |
shell: bash | |
run: | | |
for solution in ${{ env.solutions }}; do | |
dotnet restore $solution | |
done | |
- name: Build | |
shell: bash | |
run: | | |
for solution in ${{ env.solutions }}; do | |
dotnet build $solution --no-restore --configuration ${{ matrix.configuration }} | |
done | |
- name: Find unit test projects | |
shell: bash | |
run: echo "projects=$(find . -type f -name "*.UnitTests.csproj" | tr '\n' ' ')" >> $GITHUB_ENV |