Skip to content
Merged
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
Prev Previous commit
Next Next commit
Add API checks
  • Loading branch information
vbreuss committed Feb 22, 2025
commit bc9cb3eb98a5ed3c56a33eb88de6d189792da1be
30 changes: 29 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,34 @@ jobs:
./Artifacts/*
./TestResults/*.trx

api-tests:
name: "API tests"
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
- name: API checks
run: ./build.sh ApiChecks
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: API-tests
path: |
./Artifacts/*
./TestResults/*.trx

static-code-analysis:
name: "Static code analysis"
runs-on: ubuntu-latest
Expand All @@ -63,7 +91,7 @@ jobs:

publish-test-results:
name: "Publish Tests Results"
needs: [ unit-tests ]
needs: [ api-tests, unit-tests ]
runs-on: ubuntu-latest
permissions:
checks: write
Expand Down
30 changes: 29 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,34 @@ jobs:
./Artifacts/*
./TestResults/*.trx

api-tests:
name: "API tests"
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
- name: API checks
run: ./build.sh ApiChecks
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: API-tests
path: |
./Artifacts/*
./TestResults/*.trx

static-code-analysis:
name: "Static code analysis"
if: ${{ github.actor != 'dependabot[bot]' }}
Expand All @@ -64,7 +92,7 @@ jobs:

publish-test-results:
name: "Publish Tests Results"
needs: [ unit-tests ]
needs: [ api-tests, unit-tests ]
runs-on: ubuntu-latest
permissions:
checks: write
Expand Down
1 change: 1 addition & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"ExecutableTarget": {
"type": "string",
"enum": [
"ApiChecks",
"CalculateNugetVersion",
"Clean",
"CodeAnalysis",
Expand Down
28 changes: 28 additions & 0 deletions Pipeline/Build.ApiChecks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Nuke.Common;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using static Nuke.Common.Tools.DotNet.DotNetTasks;

// ReSharper disable AllUnderscoreLocalParameterName

namespace Build;

partial class Build
{
Target ApiChecks => _ => _
.DependsOn(Compile)
.Executes(() =>
{
Project project = Solution.Tests.TestableIO_System_IO_Abstractions_Api_Tests;

DotNetTest(s => s
.SetConfiguration(Configuration == Configuration.Debug ? "Debug" : "Release")
.SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US")
.EnableNoBuild()
.SetResultsDirectory(TestResultsDirectory)
.CombineWith(cc => cc
.SetProjectFile(project)
.AddLoggers($"trx;LogFileName={project.Name}.trx")), completeOnFailure: true);
});
}
Loading