diff --git a/.github/workflows/NUnit3TestAdapter.Cake.CI.yml b/.github/workflows/NUnit3TestAdapter.CI.yml similarity index 91% rename from .github/workflows/NUnit3TestAdapter.Cake.CI.yml rename to .github/workflows/NUnit3TestAdapter.CI.yml index 1dd2fc8c..cfcdfdd7 100644 --- a/.github/workflows/NUnit3TestAdapter.Cake.CI.yml +++ b/.github/workflows/NUnit3TestAdapter.CI.yml @@ -1,4 +1,5 @@ -name: NUnit3TestAdapter.Cake.CI + +name: NUnit3TestAdapter.CI on: [push, pull_request,workflow_dispatch] diff --git a/.github/workflows/NUnit3TestAdapter.Myget.Publish.yml b/.github/workflows/NUnit3TestAdapter.Myget.Publish.yml new file mode 100644 index 00000000..c7d7c1d2 --- /dev/null +++ b/.github/workflows/NUnit3TestAdapter.Myget.Publish.yml @@ -0,0 +1,59 @@ +name: NUnit3TestAdapter.Myget.Publish + +on: + push: + branches: + - main + - master + - release + - 'v3' + - myget + workflow_dispatch: + +defaults: + run: + shell: pwsh +jobs: + build-windows: + name: Windows Build + runs-on: windows-latest + + steps: + - name: ⤵️ Checkout Source + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 🛠️ Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 3.1.x + 5.0.x + 6.0.x + 7.0.x + 8.0.x + + - name: 🛠️ Install dotnet tools + run: dotnet tool restore + + - name: 🔨 Build + run: dotnet tool run dotnet-cake --configuration=Release + + - name: 📦 Package + run: dotnet tool run dotnet-cake --target=Package + + - name: 💾 Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: Package + path: package + + - name: Publish nupkg and snupkg to Myget.org + run: | + foreach($file in (Get-ChildItem package -Recurse -Include *.nupkg)) { + dotnet nuget push $file --api-key "${{ secrets.PUBLISHMYGET }}" --source https://www.myget.org/F/nunit/api/v3/index.json --skip-duplicate + } + foreach($file in (Get-ChildItem "package" -Recurse -Include *.snupkg)) { + dotnet nuget push $file --api-key "${{ secrets.PUBLISHMYGET }}" --source https://www.myget.org/F/nunit/api/v3/index.json --skip-duplicate + } diff --git a/NUnit3TestAdapter.sln b/NUnit3TestAdapter.sln index 0ad680df..8f10f870 100644 --- a/NUnit3TestAdapter.sln +++ b/NUnit3TestAdapter.sln @@ -53,6 +53,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{7D708804-B2F1-4A31-A9FB-85A0C7433200}" ProjectSection(SolutionItems) = preProject .github\workflows\NUnit3TestAdapter.Cake.CI.yml = .github\workflows\NUnit3TestAdapter.Cake.CI.yml + NUnit3TestAdapter.Myget.Publish.yml = NUnit3TestAdapter.Myget.Publish.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "netcoreapp3.1", "netcoreapp3.1", "{2F940513-5B8F-45A5-A188-7C5D03D1B50D}" diff --git a/src/NUnitTestAdapterTests/Fakes/FakeDiscoveryContext.cs b/src/NUnitTestAdapterTests/Fakes/FakeDiscoveryContext.cs index 0cbf946e..5667535d 100644 --- a/src/NUnitTestAdapterTests/Fakes/FakeDiscoveryContext.cs +++ b/src/NUnitTestAdapterTests/Fakes/FakeDiscoveryContext.cs @@ -25,16 +25,7 @@ namespace NUnit.VisualStudio.TestAdapter.Tests.Fakes; -class FakeDiscoveryContext : IDiscoveryContext +class FakeDiscoveryContext(IRunSettings runSettings) : IDiscoveryContext { - public FakeDiscoveryContext(IRunSettings runSettings) - { - RunSettings = runSettings; - } - - #region IDiscoveryContextMembers - - public IRunSettings RunSettings { get; } - - #endregion + public IRunSettings RunSettings { get; } = runSettings; } \ No newline at end of file