refactor: solution structure #12
Workflow file for this run
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
name: .NET | ||
on: | ||
pull_request: | ||
branches: [ master ] | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- '.github/workflows/dotnet-build.yml' | ||
- '*.props' | ||
- '*.sln*' | ||
jobs: | ||
build: | ||
name: Build & Test | ||
runs-on: ubuntu-latest | ||
outputs: | ||
cache-key: ${{ steps.create-cache-key.outputs.key }} | ||
permissions: | ||
packages: read | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Create cache key | ||
id: create-cache-key | ||
run: | | ||
echo key=${{ runner.os }}-${{ hashFiles('src/**', 'tests/**') }}-test-results >> "$GITHUB_OUTPUT" | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
if: steps.cache-tests.outputs.cache-hit != 'true' | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Cache nuget packages | ||
uses: actions/cache@v3 | ||
if: steps.cache-tests.outputs.cache-hit != 'true' | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-${{ hashFiles('**/*.Packages.props', '**/*.csproj') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuget- | ||
- name: move nuget config | ||
if: steps.cache-tests.outputs.cache-hit != 'true | ||
Check failure on line 46 in .github/workflows/dotnet-build.yml GitHub Actions / .NETInvalid workflow file
|
||
run: | | ||
mkdir .tmp-nuget-config | ||
mv NuGet.config .tmp-nuget-config | ||
- name: build sources | ||
if: steps.cache-tests.outputs.cache-hit != 'true | ||
run: | | ||
for csproj in $(find src | grep csproj$) | ||
do | ||
dotnet build -c Release "$csproj" | ||
done | ||
- name: move nuget config back | ||
run: | | ||
mv .tmp-nuget-config/NuGet.config . | ||
rm -rf .tmp-nuget-config | ||
- name: Build | ||
if: steps.cache-tests.outputs.cache-hit != 'true' | ||
run: dotnet build -c Debug | ||
- name: Test | ||
if: steps.cache-tests.outputs.cache-hit != 'true' | ||
run: dotnet test -c Debug --no-restore --no-build |