Skip to content

Commit

Permalink
try to fix codecov (#28)
Browse files Browse the repository at this point in the history
good enough
  • Loading branch information
connorivy authored Jan 4, 2025
1 parent 90d22f2 commit 94ecc56
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 29 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:

jobs:
build_and_pack:
runs-on: ubuntu-latest
runs-on: windows-latest
env:
ContinuousIntegrationBuild: true

steps:
- name: Checkout Code
Expand All @@ -19,28 +21,22 @@ jobs:
with:
dotnet-version: '9.0.x'

- name: Build harmony
- name: Build harmony and test runner
run: |
dotnet build ./Harmony/Harmony/Harmony.csproj -c ReleaseThin
dotnet build ./Harmony/Harmony/Harmony.csproj -f net6.0 -c ReleaseThin
dotnet build ./tests/MockMe.Tests.Runner/MockMe.Tests.Runner.csproj -c Release
- name: Test And Collect CodeCov
run: |
dotnet tool install --global dotnet-coverage
export PATH="$PATH:/root/.dotnet/tools"
dotnet-coverage collect "dotnet run --project ./tests/MockMe.Tests.Runner/" -f cobertura -s ./CodeCoverage.runsettings
- name: Generate report
uses: danielpalme/[email protected]
with:
reports: './output.cobertura.xml'
targetdir: './tests/TestResults'
reporttypes: 'lcov'
# export PATH="$PATH:/root/.dotnet/tools"
dotnet-coverage collect "dotnet run --project ./tests/MockMe.Tests.Runner/ -c Release --no-build" -f cobertura -s ./CodeCoverage.runsettings
- name: Coveralls
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
path-to-lcov: ./tests/TestResults/lcov.info
file: ./output.cobertura.xml

- name: Pack NuGet Packages
run: dotnet pack --configuration Release --output ./packages /p:Version=0.0.1-dev
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/publishWiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,32 @@ jobs:
build_and_pack:
runs-on: ubuntu-latest

env:
ContinuousIntegrationBuild: true

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: true

- name: Setup .NET 9
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0.x'

- name: Build harmony and test runner
run: |
dotnet build ./Harmony/Harmony/Harmony.csproj -f net6.0 -c ReleaseThin
dotnet build ./tests/MockMe.Tests.Runner/MockMe.Tests.Runner.csproj -c Release
- name: Test And Collect CodeCov
run: |
dotnet tool install --global dotnet-coverage
dotnet-coverage collect "dotnet run --project ./tests/MockMe.Tests.Runner/" -f cobertura -s ./CodeCoverage.runsettings
- name: Generate report
uses: danielpalme/[email protected]
with:
reports: './output.cobertura.xml'
targetdir: './tests/TestResults'
reporttypes: 'lcov'
# reporttypes: 'html'
dotnet-coverage collect "dotnet run --project ./tests/MockMe.Tests.Runner/ -c Release --no-build" -f cobertura -s ./CodeCoverage.runsettings
- name: Coveralls
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
path-to-lcov: ./tests/TestResults/lcov.info
file: ./output.cobertura.xml
1 change: 0 additions & 1 deletion MockMe.sln
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ Global
{2F9424F6-0BB5-4BD8-92A7-3625A666111F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F9424F6-0BB5-4BD8-92A7-3625A666111F}.Release|Any CPU.Build.0 = Release|Any CPU
{71009957-1245-48AD-BE28-7377CF50DA6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71009957-1245-48AD-BE28-7377CF50DA6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71009957-1245-48AD-BE28-7377CF50DA6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71009957-1245-48AD-BE28-7377CF50DA6B}.Release|Any CPU.Build.0 = Release|Any CPU
{21B57A75-EE1A-D96F-57EF-82EAF1A767EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down
4 changes: 2 additions & 2 deletions tests/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Target
<!--<Target
Name="CopySourceGeneratorOutputs"
BeforeTargets="CoreCompile"
Condition="'$(IncludeMockMeRef)' == 'True' And '$(MockMeNugetPackageVersion)' == ''"
>
<Exec Command="echo Before core compile exe: $(OutputPath) $(MockMePath)" />
<Copy SourceFiles="..\..\src\MockMe.Generator\bin\$(Configuration)\netstandard2.0\MockMe.Generator.dll" DestinationFolder="$(OutputPath)" />
<Copy SourceFiles="..\..\src\MockMe.Generator\bin\$(Configuration)\netstandard2.0\MockMe.Generator.pdb" DestinationFolder="$(OutputPath)" />
</Target>
</Target>-->
</Project>
11 changes: 10 additions & 1 deletion tests/MockMe.Tests.Runner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
Console.WriteLine(x);
}

Assembly.LoadFrom(Path.Combine(generatorBinPath, "MockMe.Generator.dll"));
//if (IsCiBuild())
//{
// Assembly.LoadFrom(Path.Combine(generatorBinPath, "MockMe.Generator.dll"));
//}

ProcessStartInfo buildStartInfo =
new() { FileName = "dotnet", Arguments = $"build --no-incremental -c Debug" };
Expand All @@ -67,3 +70,9 @@
Process.Start(testStartInfo) ?? throw new InvalidOperationException("process must not be null");

await test.WaitForExitAsync();

//static bool IsCiBuild() =>
// bool.TryParse(
// Environment.GetEnvironmentVariable("ContinuousIntegrationBuild"),
// out bool isCiBuild
// ) && isCiBuild;

0 comments on commit 94ecc56

Please sign in to comment.