Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
57 changes: 49 additions & 8 deletions .github/workflows/gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ jobs:
with:
dotnet-version: |
3.1.x
6.0.x
8.0.x
9.0.x

- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down Expand Up @@ -55,6 +53,32 @@ jobs:
flag-name: win3
parallel: true

- name: Publish NuGet artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet package
path: BitFaster.Caching/bin/Release/
win2:

runs-on: windows-latest

permissions:
checks: write

steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test (6.0)
run: dotnet test --no-restore --verbosity normal -f net6.0 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results6.trx"
- name: Upload test results (6.0)
Expand All @@ -69,7 +93,7 @@ jobs:
with:
name: test-results-win6-std
path: BitFaster.Caching.UnitTests.Std/TestResults/results6.trx

- name: Publish coverage report to coveralls.io (6.0)
uses: coverallsapp/github-action@master
with:
Expand All @@ -78,11 +102,28 @@ jobs:
flag-name: win6
parallel: true

- name: Publish NuGet artifacts
- name: Test (9.0)
run: dotnet test --no-restore --verbosity normal -f net9.0 /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov --logger "trx;LogFileName=results9.trx"
- name: Upload test results (9.0)
uses: actions/upload-artifact@v4 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-win9
path: BitFaster.Caching.UnitTests/TestResults/results9.trx
- name: Upload test results (9.0 .NET Std)
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: NuGet package
path: BitFaster.Caching/bin/Release/
name: test-results-win9-std
path: BitFaster.Caching.UnitTests.Std/TestResults/results9.trx

- name: Publish coverage report to coveralls.io (9.0)
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: BitFaster.Caching.UnitTests/TestResults/coverage.net9.0.info
flag-name: win9
parallel: true

mac:

Expand Down Expand Up @@ -170,7 +211,7 @@ jobs:

coverage:

needs: [win, mac, linux]
needs: [win, win2, mac, linux]

runs-on: ubuntu-latest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1;net6.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<TargetFrameworks>net48;netcoreapp3.1;net6.0;net9.0</TargetFrameworks>
<LangVersion>10.0</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ConcurrentLfuBuilderTests
public void TestConcurrencyLevel()
{
var b = new ConcurrentLfuBuilder<int, int>()
.WithConcurrencyLevel(-1);
.WithConcurrencyLevel(0);

Action constructor = () => { var x = b.Build(); };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void TestComparer()
public void TestConcurrencyLevel()
{
var b = new ConcurrentLruBuilder<int, int>()
.WithConcurrencyLevel(-1);
.WithConcurrencyLevel(0);

Action constructor = () => { var x = b.Build(); };

Expand Down
2 changes: 1 addition & 1 deletion BitFaster.Caching/BitFaster.Caching.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0;net9.0</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<Authors>Alex Peck</Authors>
<Company />
Expand Down
7 changes: 5 additions & 2 deletions BitFaster.Caching/Lru/Defaults.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace BitFaster.Caching.Lru
{
internal static class Defaults
{
#if NET8_0_OR_GREATER
// Note that on .net8+, -1 indicates the default concurrency level
public static int ConcurrencyLevel => -1;
#else
public static int ConcurrencyLevel => Environment.ProcessorCount;
#endif
}
}
Loading