Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add Windows test workflow and net462 test target
  • Loading branch information
flobernd committed Jul 24, 2023
commit c145975220723216059dfc2b0c0977ea700975fd
71 changes: 71 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Windows tests

on:
push:
paths-ignore:
- '*.md'
- '*.asciidoc'
- '.editorconfig'
- 'docs/**'
branches:
- main
tags:
- "*.*.*"
pull_request:
paths-ignore:
- '*.md'
- '*.asciidoc'
- '.editorconfig'
- 'docs/**'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

defaults:
run:
shell: cmd

jobs:
tests:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Fetch Tags
run: |
git fetch --prune --unshallow --tags
echo exit code $?
git tag --list

- name: NuGet package cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*') }}
restore-keys: |
${{ runner.os }}-nuget

- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- name: Test
run: ./build.bat test --report

- name: Test Results
if: success() || failure()
uses: mikepenz/action-junit-report@v3
with:
report_paths: 'build/output/junit-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_failure: true
require_tests: true
check_name: Test Results
8 changes: 7 additions & 1 deletion tests/Tests.ClusterLauncher/Tests.ClusterLauncher.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>
<PropertyGroup>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround for:

rror NU1004: The project's runtime identifiers have changed from. Project's runtime identifiers: , lock file's runtime identifiers win7-x86.The packages lock file is inconsistent with the project dependencies so restore can't be run in locked mode. Disable the RestoreLockedMode MSBuild property or pass an explicit --force-evaluate option to run restore to update the lock file.

This is a known long standing issue (see comments).

Another workaround that does not involve disabling lock files, would be this one:
NuGet/Home#9195 (comment)

<!-- https://github.com/NuGet/Home/issues/9195 -->
<!-- https://github.com/NuGet/Home/issues/10456 -->
<!-- https://github.com/dotnet/sdk/issues/26505 -->
<RestoreLockedMode>false</RestoreLockedMode>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Tests.Core\Tests.Core.csproj" />
</ItemGroup>
Expand Down
Loading