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
12 changes: 3 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ env:
MSBUILDTERMINALLOGGER: auto
Configuration: ${{ github.event.inputs.configuration || 'Release' }}
SLEET_FEED_URL: ${{ vars.SLEET_FEED_URL }}
OPENAI__KEY: ${{ secrets.OPENAI__KEY }}

defaults:
run:
Expand Down Expand Up @@ -67,7 +66,7 @@ jobs:
fetch-depth: 0

- name: ⚙ dotnet
uses: ./.github/actions/dotnet
uses: devlooped/actions-dotnet-env@v1

- name: 🙏 build
run: dotnet build -m:1 -bl:build.binlog
Expand All @@ -87,7 +86,7 @@ jobs:
- name: 🚀 sleet
env:
SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }}
if: env.SLEET_CONNECTION != '' && env.SLEET_FEED_URL != ''
if: env.SLEET_CONNECTION != ''
run: |
dotnet tool update sleet -g --allow-downgrade --version $(curl -s --compressed ${{ vars.SLEET_FEED_URL }} | jq '.["sleet:version"]' -r)
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found"
Expand All @@ -102,12 +101,7 @@ jobs:
fetch-depth: 0

- name: ⚙ dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
8.x
9.x
uses: devlooped/actions-dotnet-env@v1

- name: ✓ ensure format
run: |
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/dotnet-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: dotnet-env
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '**/*.*proj'

jobs:
which-dotnet:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: 🤖 defaults
uses: devlooped/actions-bot@v1
with:
name: ${{ secrets.BOT_NAME }}
email: ${{ secrets.BOT_EMAIL }}
gh_token: ${{ secrets.GH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: 🤘 checkout
uses: actions/checkout@v4
with:
token: ${{ env.GH_TOKEN }}

- name: 🤌 dotnet
uses: devlooped/actions-which-dotnet@v1

- name: ✍ pull request
uses: peter-evans/create-pull-request@v7
with:
base: main
branch: which-dotnet
delete-branch: true
labels: dependencies
title: "⚙ Update dotnet versions"
body: "Update dotnet versions"
commit-message: "Update dotnet versions"
token: ${{ env.GH_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fetch-depth: 0

- name: ⚙ dotnet
uses: ./.github/actions/dotnet
uses: devlooped/actions-dotnet-env@v1

- name: 🙏 build
run: dotnet build -m:1 -bl:build.binlog
Expand Down
21 changes: 13 additions & 8 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
weak
[file ".github/workflows/build.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml
sha = 08c70776943839f73dbea2e65355108747468508
sha = 56c2b8532c2f86235a0f5bd00ba6eba126f199cf

etag = fb2e91cdc9fb7a4d3e8f698e525816c5d8febb35b005c278eecca8056e78f809
etag = bf99c19427f4372ecfe38ec56aa8c411058684fb717da5661f17ac00388b3602
weak
[file ".github/workflows/changelog.config"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.config
Expand Down Expand Up @@ -77,9 +77,9 @@
weak
[file ".github/workflows/publish.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml
sha = 08c70776943839f73dbea2e65355108747468508
sha = 56c2b8532c2f86235a0f5bd00ba6eba126f199cf

etag = 722a2c7cb3a42bc24ca7fb48d2e9a336641ed0599418239e24efbafccf64bd50
etag = 2ef43521627aa3a91dd55bdc2856ec0c6a93b42485d4fe9d6b181f9ee42c8e18
weak
[file ".github/workflows/triage.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/triage.yml
Expand All @@ -101,9 +101,9 @@
weak
[file "_config.yml"]
url = https://github.com/devlooped/oss/blob/main/_config.yml
sha = fa83a5161ba52bc5d510ce0ba75ee0b1f8d4bc63
sha = 68b409c486842062e0de0e5b11e6fdb7cd12d6e2

etag = 9139148f845adf503fd3c3c140eb64421fc476a1f9c027fc50825c0efb05f557
etag = d608aa0ddaedc2d8a87260f50756e8d8314964ad4671b76bd085bcb458757010
weak
[file "assets/css/style.scss"]
url = https://github.com/devlooped/oss/blob/main/assets/css/style.scss
Expand Down Expand Up @@ -137,12 +137,17 @@
weak
[file "src/AI.Tests/Extensions/Attributes.cs"]
url = https://github.com/devlooped/catbag/blob/main/Xunit/Attributes.cs
sha = 615c1e2521340dcd85132807b368a52ff53e4ba7
sha = 40914971d4d6b42d6f8a90923b131136f7e609a5

etag = ec1645067cc2319c2ce3304900c260eb8ec700d50b6d8d62285914a6c96e01f9
etag = c77e7b435ce1df06fb60a3b0e15a0833d8e45d4d19f366c6184140ebb4814b1a
weak
[file "src/dotnet-meai/Sponsors/SponsorManifest.cs"]
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorManifest.cs
sha = a755e4be0f7cb73cfde208857e28f7cfeba2dcc3
etag = 55ef89e8441156541c1c74a50675b7f56633b56493031f0ffa877460839e3536
weak
[file ".github/workflows/dotnet-env.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-env.yml
sha = 77e83f238196d2723640abef0c7b6f43994f9747
etag = fcb9759a96966df40dcd24906fd328ddec05953b7e747a6bb8d0d1e4c3865274
weak
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
theme: jekyll-theme-slate

exclude: [ 'src/', '*.sln', 'Gemfile*', '*.rsp' ]
exclude: [ 'src/', '*.sln', '*.slnx', 'Gemfile*', '*.rsp' ]
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Extensions for [Microsoft.Extensions.AI](https://nuget.org/packages/Microsoft.Ex
[![Kori Francis](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/kfrancis.png "Kori Francis")](https://github.com/kfrancis)
[![Toni Wenzel](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/twenzel.png "Toni Wenzel")](https://github.com/twenzel)
[![Uno Platform](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/unoplatform.png "Uno Platform")](https://github.com/unoplatform)
[![Dan Siegel](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/dansiegel.png "Dan Siegel")](https://github.com/dansiegel)
[![Reuben Swartz](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/rbnswartz.png "Reuben Swartz")](https://github.com/rbnswartz)
[![Jacob Foshee](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jfoshee.png "Jacob Foshee")](https://github.com/jfoshee)
[![](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Mrxx99.png "")](https://github.com/Mrxx99)
Expand All @@ -44,8 +43,10 @@ Extensions for [Microsoft.Extensions.AI](https://nuget.org/packages/Microsoft.Ex
[![Vincent Limo](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/v-limo.png "Vincent Limo")](https://github.com/v-limo)
[![Jordan S. Jones](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jordansjones.png "Jordan S. Jones")](https://github.com/jordansjones)
[![domischell](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/DominicSchell.png "domischell")](https://github.com/DominicSchell)
[![Mauricio Scheffer](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/mausch.png "Mauricio Scheffer")](https://github.com/mausch)
[![Justin Wendlandt](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jwendl.png "Justin Wendlandt")](https://github.com/jwendl)
[![Adrian Alonso](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/adalon.png "Adrian Alonso")](https://github.com/adalon)
[![Michael Hagedorn](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Eule02.png "Michael Hagedorn")](https://github.com/Eule02)
[![Matt Frear](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/mattfrear.png "Matt Frear")](https://github.com/mattfrear)


<!-- sponsors.md -->
Expand Down
77 changes: 75 additions & 2 deletions src/AI.Tests/Extensions/Attributes.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System;
#nullable enable
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Microsoft.Extensions.Configuration;
using Xunit;

namespace Xunit;

Expand Down Expand Up @@ -45,6 +46,78 @@ public CIFactAttribute()
}
}

public class RuntimeFactAttribute : FactAttribute
{
/// <summary>
/// Use <c>nameof(OSPLatform.Windows|Linux|OSX|FreeBSD)</c>
/// </summary>
public RuntimeFactAttribute(string osPlatform)
{
if (osPlatform != null && !RuntimeInformation.IsOSPlatform(OSPlatform.Create(osPlatform)))
Skip = $"Only running on {osPlatform}.";
}

public RuntimeFactAttribute(Architecture architecture)
{
if (RuntimeInformation.ProcessArchitecture != architecture)
Skip = $"Requires {architecture} but was {RuntimeInformation.ProcessArchitecture}.";
}

/// <summary>
/// Empty constructor for use in combination with RuntimeIdentifier property.
/// </summary>
public RuntimeFactAttribute() { }

/// <summary>
/// Sets the runtime identifier the test requires to run.
/// </summary>
public string? RuntimeIdentifier
{
get => RuntimeInformation.RuntimeIdentifier;
set
{
if (value != null && RuntimeInformation.RuntimeIdentifier != value)
Skip += $"Requires {value} but was {RuntimeInformation.RuntimeIdentifier}.";
}
}
}

public class RuntimeTheoryAttribute : TheoryAttribute
{
/// <summary>
/// Use <c>nameof(OSPLatform.Windows|Linux|OSX|FreeBSD)</c>
/// </summary>
public RuntimeTheoryAttribute(string osPlatform)
{
if (osPlatform != null && !RuntimeInformation.IsOSPlatform(OSPlatform.Create(osPlatform)))
Skip = $"Only running on {osPlatform}.";
}

public RuntimeTheoryAttribute(Architecture architecture)
{
if (RuntimeInformation.ProcessArchitecture != architecture)
Skip = $"Requires {architecture} but was {RuntimeInformation.ProcessArchitecture}.";
}

/// <summary>
/// Empty constructor for use in combination with RuntimeIdentifier property.
/// </summary>
public RuntimeTheoryAttribute() { }

/// <summary>
/// Sets the runtime identifier the test requires to run.
/// </summary>
public string? RuntimeIdentifier
{
get => RuntimeInformation.RuntimeIdentifier;
set
{
if (value != null && RuntimeInformation.RuntimeIdentifier != value)
Skip += $"Requires {value} but was {RuntimeInformation.RuntimeIdentifier}.";
}
}
}

public class SecretsTheoryAttribute : TheoryAttribute
{
public SecretsTheoryAttribute(params string[] secrets)
Expand Down
Loading