Skip to content

Update dotnet.yml

Update dotnet.yml #27

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Continuous Integration
on:
workflow_dispatch:
push:
branches:
- '**'
pull_request:
branches:
- '**'
env:
BUILD_CONFIGURATION: Debug
jobs:
build:
name: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Setup .NET 6
uses: actions/setup-dotnet@main
with:
dotnet-version: 6.x
- name: Setup .NET 7
uses: actions/setup-dotnet@main
with:
dotnet-version: 7.0.306 # TEMP FIX: SDK 7.0.400 broke the Android builds
- name: Setup .NET workload Android
run: dotnet workload install android
- name: Setup JDK 17
uses: actions/setup-java@main
with:
java-version: 17
java-package: jdk
distribution: 'zulu'
- name: Setup MSBuild
uses: microsoft/setup-msbuild@main
with:
msbuild-architecture: x64
- name: Restore
run: dotnet restore src/PDFtoImage.sln
- name: Build
run: msbuild src/PDFtoImage.sln /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:VersionSuffix=ci /p:RestorePackages=false
- name: Pack
run: msbuild src/PDFtoImage/PDFtoImage.csproj /t:pack /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:VersionSuffix=ci /p:RestorePackages=false
- name: Publish libraries
uses: actions/upload-artifact@main
with:
name: Library assemblies
path: |
src/PDFtoImage/bin/${{env.BUILD_CONFIGURATION}}
!**/*.nupkg
!**/*.snupkg
if-no-files-found: error
- name: Publish tests
uses: actions/upload-artifact@main
with:
name: Test assemblies
path: src/Tests/bin/${{env.BUILD_CONFIGURATION}}
if-no-files-found: error
- name: Publish NuGet packages
uses: actions/upload-artifact@main
with:
name: NuGet packages
path: |
src/PDFtoImage/bin/${{env.BUILD_CONFIGURATION}}/*.nupkg
src/PDFtoImage/bin/${{env.BUILD_CONFIGURATION}}/*.snupkg
if-no-files-found: error
test:
name: Test (${{ matrix.os }})
needs: build
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup .NET 6
uses: actions/setup-dotnet@main
with:
dotnet-version: 6.x
- name: Setup .NET 7
uses: actions/setup-dotnet@main
with:
dotnet-version: 7.0.306 # TEMP FIX: SDK 7.0.400 broke the Android builds
- name: Download test assemblies
uses: actions/download-artifact@main
with:
name: Test assemblies
- name: .NET Framework 4.6.2
if: runner.os == 'Windows'
run: dotnet test net462/*.Tests.dll --logger trx --collect "Code Coverage"
- name: .NET Framework 4.8.1
if: runner.os == 'Windows'
run: dotnet test net481/*.Tests.dll --logger trx --collect "Code Coverage"
- name: .NET 6
run: dotnet test net6.0/*.Tests.dll --logger trx --collect "Code Coverage"
- name: .NET 7
run: dotnet test net7.0/*.Tests.dll --logger trx --collect "Code Coverage"
- name: Upload test results
uses: actions/upload-artifact@main
with:
name: Test results ${{ matrix.os }}
path: TestResults*
if: ${{ always() }}

Check failure on line 110 in .github/workflows/dotnet.yml

View workflow run for this annotation

GitHub Actions / Continuous Integration

Invalid workflow file

The workflow is not valid. .github/workflows/dotnet.yml (Line: 110, Col: 15): Unrecognized function: 'always'. Located at position 1 within expression: always()