Fix REUSE dep5 to new toml format #416
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 Core | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- '*' | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build_test_pack: | |
runs-on: windows-latest | |
steps: | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
java-package: jdk | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
cache: 'pip' | |
cache-dependency-path: '.reuse/requirements.txt' | |
- name: Install REUSE | |
run: | | |
python -m pip install --upgrade pip | |
pip install python-debian==0.1.38 | |
pip install reuse | |
- name: REUSE Compliance Check | |
run: | | |
reuse lint | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '9.x' | |
cache: true | |
cache-dependency-path: 'Directory.Packages.props' | |
- name: Cache nuget Packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('Directory.Packages.props') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~\sonar\cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache dotnet tools | |
id: cache-dotnet-tools | |
uses: actions/cache@v3 | |
with: | |
path: .\.tools | |
key: ${{ runner.os }}-dotnet-tools-${{ hashFiles('.\.tools\**\*') }} | |
restore-keys: ${{ runner.os }}-dotnet-tools- | |
- name: Install dotnet tools | |
if: steps.cache-dotnet-tools.outputs.cache-hit != 'true' | |
shell: powershell | |
run: | | |
New-Item -Path .\.tools -ItemType Directory | |
dotnet tool update minver-cli --tool-path .\.tools\minver | |
dotnet tool update dotnet-coverage --tool-path .\.tools\coverage | |
dotnet tool update dotnet-sonarscanner --tool-path .\.tools\sonarscanner | |
- name: Run minver | |
id: minver | |
shell: powershell | |
run: | | |
$version = .\.tools\minver\minver.exe | |
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
- name: nuget restore | |
run: dotnet restore './src/SmartApplicationFramework.sln' | |
- name: Build, test and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
shell: powershell | |
run: | | |
.\.tools\sonarscanner\dotnet-sonarscanner begin /k:"TRUMPF-IoT_saf" /o:"trumpf-iot" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.dotnet.excludeTestProjects=true /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml | |
if ( $LASTEXITCODE -ne 0 ) { exit $LASTEXITCODE } | |
dotnet build './src/SmartApplicationFramework.sln' --configuration Release --no-restore | |
if ( $LASTEXITCODE -ne 0 ) { exit $LASTEXITCODE } | |
.\.tools\coverage\dotnet-coverage collect -f xml -o coverage.xml 'dotnet test ./src/SmartApplicationFramework.sln --configuration Release --no-build --no-restore --verbosity normal' | |
if ( $LASTEXITCODE -ne 0 ) { exit $LASTEXITCODE } | |
.\.tools\sonarscanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" | |
if ( $LASTEXITCODE -ne 0 ) { exit $LASTEXITCODE } | |
- name: Pack | |
run: | | |
mkdir -p ./artifacts | |
dotnet pack './src/SmartApplicationFramework.sln' --configuration Release --no-build --output './artifacts' | |
- name: Upload artifacts | |
if: github.event_name == 'push' && (contains(github.ref, 'refs/tags/') || contains(github.ref, 'refs/heads/master')) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SmartApplicationFramework-${{ steps.minver.outputs.version }} | |
path: ./artifacts | |
- name: Publish nuget packages | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
run: | | |
dotnet nuget push ".\artifacts\*.nupkg" --api-key "${{secrets.SAF_NUGETORG_APIKEY}}" --source https://api.nuget.org/v3/index.json --skip-duplicate |