Skip to content

Commit

Permalink
add code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Jul 4, 2024
1 parent f8285e6 commit 37743e7
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ jobs:

- name: ⚒️ Run build
run: ./build.ps1

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
with:
files: tests/**/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}

- name: ⬆️ Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
1 change: 0 additions & 1 deletion Build/Consts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
public static class Consts
{
public static readonly string[] Solutions = ["Speckle.Connectors.sln" ];
public static readonly string[] TestProjects = [];

public static readonly InstallerProject[] InstallerManifests =
{
Expand Down
15 changes: 4 additions & 11 deletions Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void RemoveDirectory(string d)

Target(
RESTORE,
DependsOn(FORMAT),
Consts.Solutions,
s =>
{
Expand Down Expand Up @@ -111,18 +112,10 @@ void RemoveDirectory(string d)
Target(
TEST,
DependsOn(BUILD),
Consts.TestProjects,
t =>
Glob.Files(".", "**/*.Tests.csproj"),
file =>
{
IEnumerable<string> GetFiles(string d)
{
return Glob.Files(".", d);
}

foreach (var file in GetFiles($"**/{t}.csproj"))
{
Run("dotnet", $"test {file} -c Release --no-build --no-restore --verbosity=normal /p:AltCover=true");
}
Run("dotnet", $"test {file} -c Release --no-build --no-restore --verbosity=normal /p:AltCover=true");
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="altcover" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"version": 2,
"dependencies": {
"net8.0": {
"altcover": {
"type": "Direct",
"requested": "[8.8.74, )",
"resolved": "8.8.74",
"contentHash": "e8RZNE0vZnuBk/gOAWu9K5wm3S7dOrOlZje3PHI9PJUHqvP1cxVJD1eXAAmddFVlixowB7C7/zvC16GnunC2LQ=="
},
"FluentAssertions": {
"type": "Direct",
"requested": "[6.12.0, )",
Expand Down Expand Up @@ -476,7 +482,7 @@
"speckle.converters.common": {
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.0.1-alpha.14, )"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="altcover" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"version": 2,
"dependencies": {
"net8.0": {
"altcover": {
"type": "Direct",
"requested": "[8.8.74, )",
"resolved": "8.8.74",
"contentHash": "e8RZNE0vZnuBk/gOAWu9K5wm3S7dOrOlZje3PHI9PJUHqvP1cxVJD1eXAAmddFVlixowB7C7/zvC16GnunC2LQ=="
},
"FluentAssertions": {
"type": "Direct",
"requested": "[6.12.0, )",
Expand Down

0 comments on commit 37743e7

Please sign in to comment.