Skip to content

refactor: solution structure #12

refactor: solution structure

refactor: solution structure #12

Workflow file for this run

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

View workflow run for this annotation

GitHub Actions / .NET

Invalid workflow file

The workflow is not valid. .github/workflows/dotnet-build.yml (Line: 46, Col: 13): Unexpected symbol: ''true'. Located at position 40 within expression: steps.cache-tests.outputs.cache-hit != 'true .github/workflows/dotnet-build.yml (Line: 52, Col: 13): Unexpected symbol: ''true'. Located at position 40 within expression: steps.cache-tests.outputs.cache-hit != 'true
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