Merge pull request #1630 from wabbajack-tools/rework-build-action

Run all tests in one action
This commit is contained in:
Timothy Baldridge 2021-09-27 21:44:28 -06:00 committed by GitHub
commit 10446c0c48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 26 deletions

View File

@ -24,19 +24,6 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
project:
- Wabbajack.Compiler.Test
- Wabbajack.Compression.BSA.Test
- Wabbajack.Downloaders.Dispatcher.Test
- Wabbajack.DTOs.Test
- Wabbajack.FileExtractor.Test
- Wabbajack.Hashing.PHash.Test
- Wabbajack.Hashing.xxHash64.Test
- Wabbajack.Installer.Test
- Wabbajack.Networking.NexusApi.Test
- Wabbajack.Paths.Test
- Wabbajack.Paths.IO.Test
- Wabbajack.VFS.Test
steps:
- uses: actions/checkout@v2
@ -52,23 +39,29 @@ jobs:
include-prerelease: true
- name: Install dependencies
run: dotnet restore ${{ matrix.project }}/${{ matrix.project }}.csproj
run: dotnet restore
- name: Build
run: dotnet build ${{ matrix.project }}/${{ matrix.project }}.csproj --configuration Release --no-restore
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test ${{ matrix.project }}/${{ matrix.project }}.csproj --no-restore
run: dotnet test --no-restore
publish:
name: Publish ${{ matrix.project }}
name: Publish Projects
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
strategy:
matrix:
project:
- Wabbajack.CLI
- Wabbajack.Common
- Wabbajack.Compiler
- Wabbajack.Compression.BSA
- Wabbajack.Downloaders.Interfaces
- Wabbajack.Downloaders.Dispatcher
- Wabbajack.Compression.BSA
- Wabbajack.Downloaders.IPS4OAuth2Downloader
- Wabbajack.Downloaders.MediaFire
- Wabbajack.Downloaders.Mega
- Wabbajack.Downloaders.ModDB
- Wabbajack.Downloaders.GoogleDrive
- Wabbajack.Downloaders.Http
- Wabbajack.Downloaders.Nexus
@ -78,6 +71,8 @@ jobs:
- Wabbajack.Hashing.PHash
- Wabbajack.Hashing.xxHash64
- Wabbajack.Installer
- Wabbajack.Networking.Discord
- Wabbajack.Networking.GitHub
- Wabbajack.Networking.Http
- Wabbajack.Networking.Http.Interfaces
- Wabbajack.Networking.NexusApi
@ -86,7 +81,6 @@ jobs:
- Wabbajack.Paths.IO
- Wabbajack.RateLimiter
- Wabbajack.VFS
needs: build
steps:

View File

@ -37,6 +37,6 @@
<Target Name="AferBuild" AfterTargets="Build">
<Message Text="Downloading Cef" />
<Exec Command="$(OutDir)wabbajack-cli.exe download-cef" />
<Exec Command="dotnet run --project $(ProjectDir)../Wabbajack.CLI/Wabbajack.CLI.csproj -- download-cef -f $(ProjectDir)$(OutDir)" />
</Target>
</Project>

View File

@ -127,16 +127,22 @@ namespace Wabbajack.CLI.DTOs
public File FindSource(string downloadVersion)
{
var tuple = (OSDescription.Split(" ").First().Trim(), ProcessArchitecture);
if (OSDescription.StartsWith("Microsoft Windows"))
tuple = ("Windows", tuple.ProcessArchitecture);
string os = "";
if (IsOSPlatform(OSPlatform.Linux))
os = "Linux";
if (IsOSPlatform(OSPlatform.Windows))
os = "Windows";
if (IsOSPlatform(OSPlatform.OSX))
os = "OSX";
var tuple = (os, ProcessArchitecture);
List<Version> versions = new();
if (tuple == ("Linux", Architecture.X64)) versions = Linux64.Versions;
else if (tuple == ("Linux", Architecture.X86)) versions = Linux32.Versions;
else if (tuple == ("Windows", Architecture.X64)) versions = Windows64.Versions;
else if (tuple == ("OSX", Architecture.X64)) versions = Macosx64.Versions;
var version = versions.Where(v => v.CefVersion.StartsWith(downloadVersion + "."))
.OrderByDescending(v => v.ChromiumVersion)

View File

@ -109,7 +109,7 @@ namespace Wabbajack.RateLimiter.Test
{
tasks.Add(Task.Run(async () =>
{
using var job = await rateLimiter.Begin("Transferring", 1024 * 1024 / 10 * 5,CancellationToken.None);
using var job = await rateLimiter.Begin("Transferring", 1024 * 1024 / 10 * 5, CancellationToken.None);
for (var x = 0; x < 5; x++)
{
await job.Report(1024 * 1024 / 10, CancellationToken.None);
@ -120,7 +120,7 @@ namespace Wabbajack.RateLimiter.Test
await WhenAll(tasks.ToArray());
var elapsed = sw.Elapsed;
Assert.True(elapsed > TimeSpan.FromSeconds(0.5));
Assert.True(elapsed < TimeSpan.FromSeconds(1));
Assert.True(elapsed < TimeSpan.FromSeconds(1.5));
}
}
}