Skip to content

ci: fix multi-line command in yaml #85

ci: fix multi-line command in yaml

ci: fix multi-line command in yaml #85

Workflow file for this run

name: .NET Multi-platform Verification
on:
push:
paths-ignore:
- 'LICENSE.md'
- 'README.md'
- '.editorconfig'
- '.github/workflows/publish.yml'
pull_request:
branches:
- master
- devel
jobs:
linux-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v4
with:
path: ./.sonar/scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: pwsh
run: |
New-Item -Path ./.sonar/scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
- name: Install dependencies
run: dotnet restore CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
- name: SonarCloud Begin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: pwsh
run: ./.sonar/scanner/dotnet-sonarscanner begin /k:"dmako_CommonNetExtensions" /o:"dmako-github" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="coverage/**/coverage.opencover.xml"
- name: Build Tests
run: dotnet build --configuration Release --no-restore CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
- name: Tests
shell: pwsh
run: |
$currentDirectory = Get-Location
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net8.0 --coverage-output $currentDirectory/coverage/net8.0/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net9.0 --coverage-output $currentDirectory/coverage/net9.0/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
- name: SonarCloud End
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: pwsh
run: ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
working-directory: coverage
flags: unittests
os: linux
windows-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Install dependencies
run: dotnet restore CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
- name: Build Tests
run: dotnet build --configuration Release --no-restore CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
- name: Tests
shell: pwsh
run: |
$currentDirectory = Get-Location
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net48 --coverage-output $currentDirectory/coverage/net48/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net8.0 --coverage-output $currentDirectory/coverage/net8.0/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
dotnet run --no-restore --configuration Release --no-build --verbosity normal --framework net9.0 --coverage-output $currentDirectory/coverage/net9.0/coverage.opencover.xml --coverage-output-format cobertura --coverage --project CommonNet.Extensions.Tests/CommonNet.Extensions.Tests.csproj
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
working-directory: coverage
flags: unittests
os: windows