diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b126dc..d6bd793 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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 @@ -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" @@ -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: | diff --git a/.github/workflows/dotnet-env.yml b/.github/workflows/dotnet-env.yml new file mode 100644 index 0000000..a76d0fd --- /dev/null +++ b/.github/workflows/dotnet-env.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4ffa001..03e57d9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 diff --git a/.netconfig b/.netconfig index d621926..d4e4480 100644 --- a/.netconfig +++ b/.netconfig @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/_config.yml b/_config.yml index a61f7e0..04e6093 100644 --- a/_config.yml +++ b/_config.yml @@ -1,3 +1,3 @@ theme: jekyll-theme-slate -exclude: [ 'src/', '*.sln', 'Gemfile*', '*.rsp' ] \ No newline at end of file +exclude: [ 'src/', '*.sln', '*.slnx', 'Gemfile*', '*.rsp' ] diff --git a/readme.md b/readme.md index 1f4f175..8bbcdf9 100644 --- a/readme.md +++ b/readme.md @@ -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) @@ -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) diff --git a/src/AI.Tests/Extensions/Attributes.cs b/src/AI.Tests/Extensions/Attributes.cs index cbab72e..a98cd3b 100644 --- a/src/AI.Tests/Extensions/Attributes.cs +++ b/src/AI.Tests/Extensions/Attributes.cs @@ -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; @@ -45,6 +46,78 @@ public CIFactAttribute() } } +public class RuntimeFactAttribute : FactAttribute +{ + /// + /// Use nameof(OSPLatform.Windows|Linux|OSX|FreeBSD) + /// + 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}."; + } + + /// + /// Empty constructor for use in combination with RuntimeIdentifier property. + /// + public RuntimeFactAttribute() { } + + /// + /// Sets the runtime identifier the test requires to run. + /// + public string? RuntimeIdentifier + { + get => RuntimeInformation.RuntimeIdentifier; + set + { + if (value != null && RuntimeInformation.RuntimeIdentifier != value) + Skip += $"Requires {value} but was {RuntimeInformation.RuntimeIdentifier}."; + } + } +} + +public class RuntimeTheoryAttribute : TheoryAttribute +{ + /// + /// Use nameof(OSPLatform.Windows|Linux|OSX|FreeBSD) + /// + 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}."; + } + + /// + /// Empty constructor for use in combination with RuntimeIdentifier property. + /// + public RuntimeTheoryAttribute() { } + + /// + /// Sets the runtime identifier the test requires to run. + /// + 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)